summaryrefslogtreecommitdiffstats
path: root/quanta/components/csseditor/cssselector.h
blob: a71f587bda33edd1ceec09b4bd023ea72fb009af (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
/***************************************************************************
                          cssselector.h  -  description
                             -------------------
    begin                : mer ago 6 2003
    copyright            : (C) 2003 by gulmini luciano
    email                : gulmini.luciano@student.unife.it
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CSSSELECTOR_H
#define CSSSELECTOR_H

#include <tqmap.h>
#include <tqpair.h>
#include "cssselectors.h"

class TQListViewItem;
class TQStringList;
/**
  *@author gulmini luciano
  */

class CSSSelector : public CSSSelectorS {
  Q_OBJECT
  

  private:
    TQListViewItem *m_currentItem;
    TQListView *m_currentListView;
    TQString m_header,
                 m_footer,
                 m_callingFrom,
                 m_fileToPreview;
    TQMap<TQString, TQPair<TQString,unsigned int> > m_currentStylesheetStructure;
    unsigned int m_orderNumber;
    bool m_stopProcessingStylesheet;

    void Connect();

  public:
    CSSSelector(TQWidget *parent=0, const char* name=0);
    ~CSSSelector();
    void loadCSSContent(const TQString& s);
    void setHeader(const TQString& h) { m_header = h; }
    void setFooter(const TQString& f) { m_footer = f; }
    void enableApplyToFile();
    void setCallingFrom(const TQString& cf){ m_callingFrom = cf ;}
    void setFileToPreview(const TQString& s){ m_fileToPreview=s;}
    bool errorOnProcessingStylesheet() const { return m_stopProcessingStylesheet; }
    TQString generateFormattedStyleSection();

  private slots:
    void openCSSEditor(TQListViewItem *);
    void addTag();
    void addClass();
    void addID();
    void addPseudo();
    void removeAll();
    void removeSelected();
    void setCurrentItem(TQListViewItem* i) { m_currentItem = i; }
    void setCurrentListView(TQWidget*);
    void setDTDTags(const TQString&);
    void setStylesheetProcessing(const TQString&);
};

#endif