• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • part
kateattribute.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef __KATE_ATTRIBUTE_H__
20 #define __KATE_ATTRIBUTE_H__
21 
22 #include "katefont.h"
23 
24 #include <tqcolor.h>
25 
32 class KateAttribute
33 {
34 public:
35  enum items {
36  Weight = 0x1,
37  Bold = 0x2,
38  Italic = 0x4,
39  Underline = 0x8,
40  StrikeOut = 0x10,
41  Outline = 0x20,
42  TextColor = 0x40,
43  SelectedTextColor = 0x80,
44  BGColor = 0x100,
45  SelectedBGColor = 0x200,
46  Overline = 0x400
47  };
48 
49  KateAttribute();
50  virtual ~KateAttribute();
51 
52  TQFont font(const TQFont& ref);
53 
54  inline int width(KateFontStruct& fs, const TQString& text, int col, int tabWidth) const
55  { return fs.width(text, col, bold(), italic(), tabWidth); };
56 
57  // Non-preferred function when you have a string and you want one char's width!!
58  inline int width(KateFontStruct& fs, const TQChar& c, int tabWidth) const
59  { return fs.width(c, bold(), italic(), tabWidth); };
60 
61  inline bool itemSet(int item) const
62  { return item & m_itemsSet; };
63 
64  inline bool isSomethingSet() const
65  { return m_itemsSet; };
66 
67  inline int itemsSet() const
68  { return m_itemsSet; };
69 
70  inline void clearAttribute(int item)
71  { m_itemsSet &= (~item); }
72 
73  inline int weight() const
74  { return m_weight; };
75 
76  void setWeight(int weight);
77 
78  inline bool bold() const
79  { return weight() >= TQFont::Bold; };
80 
81  void setBold(bool enable = true);
82 
83  inline bool italic() const
84  { return m_italic; };
85 
86  void setItalic(bool enable = true);
87 
88  inline bool overline() const
89  { return m_overline; };
90 
91  void setOverline(bool enable = true);
92 
93  inline bool underline() const
94  { return m_underline; };
95 
96  void setUnderline(bool enable = true);
97 
98  inline bool strikeOut() const
99  { return m_strikeout; };
100 
101  void setStrikeOut(bool enable = true);
102 
103  inline const TQColor& outline() const
104  { return m_outline; };
105 
106  void setOutline(const TQColor& color);
107 
108  inline const TQColor& textColor() const
109  { return m_textColor; };
110 
111  void setTextColor(const TQColor& color);
112 
113  inline const TQColor& selectedTextColor() const
114  { return m_selectedTextColor; };
115 
116  void setSelectedTextColor(const TQColor& color);
117 
118  inline const TQColor& bgColor() const
119  { return m_bgColor; };
120 
121  void setBGColor(const TQColor& color);
122 
123  inline const TQColor& selectedBGColor() const
124  { return m_selectedBGColor; };
125 
126  void setSelectedBGColor(const TQColor& color);
127 
128  KateAttribute& operator+=(const KateAttribute& a);
129 
130  friend bool operator ==(const KateAttribute& h1, const KateAttribute& h2);
131  friend bool operator !=(const KateAttribute& h1, const KateAttribute& h2);
132 
133  virtual void changed() { m_changed = true; };
134  bool isChanged() { bool ret = m_changed; m_changed = false; return ret; };
135 
136  void clear();
137 
138 private:
139  int m_weight;
140  bool m_italic, m_underline, m_overline,m_strikeout, m_changed;
141  TQColor m_outline, m_textColor, m_selectedTextColor, m_bgColor, m_selectedBGColor;
142  int m_itemsSet;
143 };
144 
145 #endif
KateAttribute
The Attribute class incorporates all text decorations supported by Kate.
Definition: kateattribute.h:32

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.8.8
This website is maintained by Timothy Pearson.