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

kdefx

  • kdefx
kstyle.h
1 /*
2  * $Id$
3  *
4  * KStyle
5  * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org>
6  *
7  * TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech,
8  * Copyright (C) 1998-2000 TrollTech AS.
9  *
10  * Many thanks to Bradley T. Hughes for the 3 button scrollbar code.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License version 2 as published by the Free Software Foundation.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public License
22  * along with this library; see the file COPYING.LIB. If not, write to
23  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24  * Boston, MA 02110-1301, USA.
25  */
26 
27 #ifndef __KSTYLE_H
28 #define __KSTYLE_H
29 
30 // W A R N I N G
31 // -------------
32 // This API is still subject to change.
33 // I will remove this warning when I feel the API is sufficiently flexible.
34 
35 #include <tqcommonstyle.h>
36 
37 #include <kdelibs_export.h>
38 
39 class KPixmap;
40 
41 struct KStylePrivate;
57 class KDEFX_EXPORT KStyle: public TQCommonStyle
58 {
59  Q_OBJECT
60  TQ_OBJECT
61 
62  public:
63 
80  typedef uint KStyleFlags;
81  enum KStyleOption {
82  Default = 0x00000000,
83  AllowMenuTransparency = 0x00000001,
84  FilledFrameWorkaround = 0x00000002
85  };
86 
110  enum KStyleScrollBarType {
111  WindowsStyleScrollBar = 0x00000000,
112  PlatinumStyleScrollBar = 0x00000001,
113  ThreeButtonScrollBar = 0x00000002,
114  NextStyleScrollBar = 0x00000004
115  };
116 
136  KStyle( KStyleFlags flags = KStyle::Default,
137  KStyleScrollBarType sbtype = KStyle::WindowsStyleScrollBar );
138 
142  ~KStyle();
143 
147  static TQString defaultStyle();
148 
160  void setScrollBarType(KStyleScrollBarType sbtype);
161 
167  KStyleFlags styleFlags() const;
168 
169  // ---------------------------------------------------------------------------
170 
182  virtual void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup& cg,
183  const TQPopupMenu* popup ) const;
184 
228  enum KStylePrimitive {
229  KPE_DockWindowHandle,
230  KPE_ToolBarHandle,
231  KPE_GeneralHandle,
232 
233  KPE_SliderGroove,
234  KPE_SliderHandle,
235 
236  KPE_ListViewExpander,
237  KPE_ListViewBranch
238  };
239 
249  virtual void drawKStylePrimitive( KStylePrimitive kpe,
250  TQPainter* p,
251  const TQWidget* widget,
252  const TQRect &r,
253  const TQColorGroup &cg,
254  SFlags flags = Style_Default,
255  const TQStyleOption& = TQStyleOption::SO_Default ) const;
256 
257 
258  enum KStylePixelMetric {
259  KPM_MenuItemSeparatorHeight = 0x00000001,
260  KPM_MenuItemHMargin = 0x00000002,
261  KPM_MenuItemVMargin = 0x00000004,
262  KPM_MenuItemHFrame = 0x00000008,
263  KPM_MenuItemVFrame = 0x00000010,
264  KPM_MenuItemCheckMarkHMargin = 0x00000020,
265  KPM_MenuItemArrowHMargin = 0x00000040,
266  KPM_MenuItemTabSpacing = 0x00000080,
267  KPM_ListViewBranchThickness = 0x00000100
268  };
269 
270  int kPixelMetric( KStylePixelMetric kpm, const TQWidget* widget = 0 ) const;
271 
272  // ---------------------------------------------------------------------------
273 
274  void polish( TQWidget* widget );
275  void unPolish( TQWidget* widget );
276  void polishPopupMenu( TQPopupMenu* );
277 
278  void tqdrawPrimitive( TQ_PrimitiveElement pe,
279  TQPainter* p,
280  const TQRect &r,
281  const TQColorGroup &cg,
282  SFlags flags = Style_Default,
283  const TQStyleOption& = TQStyleOption::SO_Default ) const;
284 
285 // #ifdef USE_QT4 // kdebindings / smoke needs this function declaration available at all times. Furthermore I don't think it would hurt to have the declaration available at all times...so leave these commented out for now
286 
287 // void tqdrawPrimitive( TQ_ControlElement pe,
288 // TQPainter* p,
289 // const TQRect &r,
290 // const TQColorGroup &cg,
291 // SFlags flags = Style_Default,
292 // const TQStyleOption& = TQStyleOption::SO_Default ) const;
293 
294 // #endif // USE_QT4
295 
296  void drawControl( TQ_ControlElement element,
297  TQPainter* p,
298  const TQWidget* widget,
299  const TQRect &r,
300  const TQColorGroup &cg,
301  SFlags flags = Style_Default,
302  const TQStyleOption& = TQStyleOption::SO_Default ) const;
303 
304  void drawComplexControl( TQ_ComplexControl control,
305  TQPainter *p,
306  const TQWidget* widget,
307  const TQRect &r,
308  const TQColorGroup &cg,
309  SFlags flags = Style_Default,
310  SCFlags controls = SC_All,
311  SCFlags active = SC_None,
312  const TQStyleOption& = TQStyleOption::SO_Default ) const;
313 
314  SubControl querySubControl( TQ_ComplexControl control,
315  const TQWidget* widget,
316  const TQPoint &pos,
317  const TQStyleOption& = TQStyleOption::SO_Default ) const;
318 
319  TQRect querySubControlMetrics( TQ_ComplexControl control,
320  const TQWidget* widget,
321  SubControl sc,
322  const TQStyleOption& = TQStyleOption::SO_Default ) const;
323 
324  int pixelMetric( PixelMetric m,
325  const TQWidget* widget = 0 ) const;
326 
327  TQRect subRect( SubRect r,
328  const TQWidget* widget ) const;
329 
330  TQPixmap stylePixmap( StylePixmap stylepixmap,
331  const TQWidget* widget = 0,
332  const TQStyleOption& = TQStyleOption::SO_Default ) const;
333 
334  int styleHint( TQ_StyleHint sh,
335  const TQWidget* w = 0,
336  const TQStyleOption &opt = TQStyleOption::SO_Default,
337  TQStyleHintReturn* shr = 0 ) const;
338 
339  protected:
340  bool eventFilter( TQObject* object, TQEvent* event );
341 
342  private:
343  // Disable copy constructor and = operator
344  KStyle( const KStyle & );
345  KStyle& operator=( const KStyle & );
346 
347  protected:
348  virtual void virtual_hook( int id, void* data );
349  private:
350  KStylePrivate *d;
351 };
352 
353 
354 // vim: set noet ts=4 sw=4:
355 #endif
356 

kdefx

Skip menu "kdefx"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdefx

Skip menu "kdefx"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdefx by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |