Scribus
Open source desktop publishing at your fingertips
loremipsum.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef _LOREMIPSUM_H_
17 #define _LOREMIPSUM_H_
18 
19 #include <QDialog>
20 #include <QMap>
21 
22 #include "scribusapi.h"
23 
24 class QEvent;
25 class QGridLayout;
26 class QHBoxLayout;
27 class QLabel;
28 class QPushButton;
29 class QSpacerItem;
30 class QSpinBox;
31 class QCheckBox;
32 class QString;
33 class QStringList;
34 class QTreeWidget;
35 class QVBoxLayout;
36 
37 class ScribusDoc;
38 class UndoManager;
39 // class LanguageManager;
40 
41 
46 class SCRIBUS_API LoremParser
47 {
48 public:
51  LoremParser(QString filename);
53 
55  bool correct;
57  QString name;
59  QString author;
61  QString url;
63  QStringList loremIpsum;
64 
67  QString createLorem(uint parCount, bool random = true);
68 };
69 
84 class SCRIBUS_API LoremManager : public QDialog
85 {
86  Q_OBJECT
87 
88 public:
90  LoremManager(ScribusDoc* doc, QWidget* parent = 0);
91 
96  void insertLoremIpsum(QString name, int paraCount, bool random = true);
97 
99  QString loremIpsum();
100 
102  int paragraphCount();
103 
105  QString getName();
106 
108  bool randomize();
109 
110 
111 private:
112  ScribusDoc* m_Doc;
113  QTreeWidget* loremList;
114  QLabel* paraLabel;
115  QSpinBox* paraBox;
116  QCheckBox* randomCheckBox;
117  QCheckBox* appendCheckBox;
118  QPushButton* okButton;
119  QPushButton* cancelButton;
120  QGridLayout* LoremManagerLayout;
121  QVBoxLayout* layout3;
122  QHBoxLayout* layout2;
123  QSpacerItem* paraSpacer;
124  QHBoxLayout* layout1;
125  QSpacerItem* buttonSpacer;
126  QString standardloremtext;
127  UndoManager* undoManager;
128 
130  QMap<QString,QString> availableLorems;
131 
132  virtual void changeEvent(QEvent *e);
133 
134 protected slots:
135  virtual void languageChange();
136 
137 };
138 
139 #endif
This module provides simple interface to the various Lorem Ipsum variants. Scribus LI are stored in t...
Definition: loremipsum.h:84
QString author
Author of the LI.
Definition: loremipsum.h:59
the Document Class
Definition: scribusdoc.h:90
XML parser for Lorem Ipsum file. This helper class reads one file.
Definition: loremipsum.h:46
QString url
Website of the LI.
Definition: loremipsum.h:61
QString name
Name to display.
Definition: loremipsum.h:57
QStringList loremIpsum
Paragraphs of the LI.
Definition: loremipsum.h:63
UndoManager handles the undo stack.
Definition: undomanager.h:81