src/Primitives.h

changeset 642
751a8df42842
parent 641
425b169a82aa
equal deleted inserted replaced
641:425b169a82aa 642:751a8df42842
25 class LDDocument; 25 class LDDocument;
26 class Ui_MakePrimUI; 26 class Ui_MakePrimUI;
27 class PrimitiveCategory; 27 class PrimitiveCategory;
28 struct Primitive 28 struct Primitive
29 { 29 {
30 QString name, title; 30 QString name,
31 PrimitiveCategory* cat; 31 title;
32 PrimitiveCategory* category;
32 }; 33 };
33 34
34 class PrimitiveCategory : public QObject 35 class PrimitiveCategory : public QObject
35 { 36 {
36 Q_OBJECT 37 Q_OBJECT
37 PROPERTY (public, QString, Name, STR_OPS, STOCK_WRITE) 38 PROPERTY (public, QString, name, setName, STOCK_WRITE)
38 39
39 public: 40 public:
40 enum ERegexType 41 enum RegexType
41 { 42 {
42 EFilenameRegex, 43 EFilenameRegex,
43 ETitleRegex 44 ETitleRegex
44 }; 45 };
45 46
46 struct RegexEntry 47 struct RegexEntry
47 { 48 {
48 QRegExp regex; 49 QRegExp regex;
49 ERegexType type; 50 RegexType type;
50 }; 51 };
51 52
52 QList<RegexEntry> regexes; 53 QList<RegexEntry> regexes;
53 QList<Primitive> prims; 54 QList<Primitive> prims;
54 55
58 static void loadCategories(); 59 static void loadCategories();
59 static void populateCategories(); 60 static void populateCategories();
60 }; 61 };
61 62
62 // ============================================================================= 63 // =============================================================================
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 64 //
64 // =============================================================================
65 // PrimitiveScanner 65 // PrimitiveScanner
66 // 66 //
67 // Worker object that scans the primitives folder for primitives and 67 // Worker object that scans the primitives folder for primitives and
68 // builds an index of them. 68 // builds an index of them.
69 // ============================================================================= 69 //
70 class PrimitiveScanner : public QObject 70 class PrimitiveScanner : public QObject
71 { 71 {
72 Q_OBJECT 72 Q_OBJECT
73 73
74 public: 74 public:

mercurial