summaryrefslogtreecommitdiffstats
path: root/quanta/dialogs/dtepeditdlg.h
blob: a570881daf5aef264362020c06da24e8fc8eb867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/***************************************************************************
                          dtepeditdlg.h  -  description
                             -------------------
    begin                : Tue Feb 1 11:07:24 2005
    copyright            : (C) 2005 Andras Mantia <amantia@kde.org>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; version 2 of the License.               *
 *                                                                         *
 ***************************************************************************/

#ifndef DTEPEDITDLG_H
#define DTEPEDITDLG_H

//qt includes
#include <tqvaluelist.h>

//own includes
#include "dtepeditdlgs.h"

/**
@author Andras Mantia
*/

class TDEConfig;
class DTEPStructureEditDlgS;

struct StructGroup {
  TQString name;   ///<the name of the group
  TQString noName; ///<the text when there are no elements in the group
  TQString icon;   ///<the icon of the group
  TQString tag;
  bool hasFileName;
  TQString fileNameRx;
  bool appendToTags;
  TQString parentGroup;
  TQString definitionRx;
  bool definitionRxMinimal;
  TQString usageRx;
  TQString typeRx;
  TQString tagType;
  bool parseFile;
  TQString completeAfterRx;
  TQString removeRx;
  bool simpleGroup;
  bool variableGroup;
  bool functionGroup;
  bool classGroup;
  bool objectGroup;
};

class DTEPEditDlg : public DTEPEditDlgS
{
  Q_OBJECT
  
  public:
    DTEPEditDlg(const TQString& descriptionFile, TQWidget *parent = 0, const char *name = 0);
    ~DTEPEditDlg();
    void saveResult();
    void slotFamilyChanged(int family);
    void slotEditStructGroup();
    void slotAddStructGroup();
    void slotDeleteStructGroup();
    
  private:  
    void init();
    void readGeneral();
    void readPages();
    void readParserRules();
    void readStructures();
    StructGroup readFromStructDlg(DTEPStructureEditDlgS *structDlg);
    
    void writeGeneral(TDEConfig *config);
    void writePages(TDEConfig *config);
    void writeParserRules(TDEConfig *config);
    void writeStructures(TDEConfig *config);
    void writeEntry(TDEConfig *config, const TQString &key, const TQString &value);
    
  TQString m_descriptionFile;
  TDEConfig *m_config;
  int m_family;
  TQWidget *m_pagesWidget;
  TQValueList<StructGroup> m_structGroups;
};

#endif