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

kmdi

  • kmdi
kmdichildfrm.h
1 //----------------------------------------------------------------------------
2 // filename : kmdichildfrm.h
3 //----------------------------------------------------------------------------
4 // Project : KDE MDI extension
5 //
6 // begin : 07/1999 by Szymon Stefanek as part of kvirc
7 // (an IRC application)
8 // changes : 09/1999 by Falk Brettschneider to create an
9 // - 06/2000 stand-alone Qt extension set of
10 // classes and a Qt-based library
11 // 2000-2003 maintained by the KDevelop project
12 // patches : */2000 Lars Beikirch (Lars.Beikirch@gmx.net)
13 //
14 // copyright : (C) 1999-2003 by Falk Brettschneider
15 // and
16 // Szymon Stefanek (stefanek@tin.it)
17 // email : falkbr@kdevelop.org (Falk Brettschneider)
18 //----------------------------------------------------------------------------
19 //
20 //----------------------------------------------------------------------------
21 //
22 // This program is free software; you can redistribute it and/or modify
23 // it under the terms of the GNU Library General Public License as
24 // published by the Free Software Foundation; either version 2 of the
25 // License, or (at your option) any later version.
26 //
27 //------------------------------------------------------------------------------
28 #ifndef _KMDI_CHILD_FRM_H_
29 #define _KMDI_CHILD_FRM_H_
30 
31 #include <tqptrlist.h>
32 #include <tqpixmap.h>
33 #include <tqpushbutton.h>
34 #include <tqlabel.h>
35 #include <tqdatetime.h>
36 #include <tqlayout.h>
37 
38 #include <tqdict.h>
39 
40 #include "kmdichildfrmcaption.h"
41 
42 class KMdiChildArea;
43 class KMdiChildView;
44 class TQPopupMenu;
45 class TQToolButton;
46 
47 //==============================================================================
52 class KMDI_EXPORT KMdiWin32IconButton : public TQLabel
53 {
54  Q_OBJECT
55 public:
56  KMdiWin32IconButton( TQWidget* parent, const char* name = 0 );
57  virtual void mousePressEvent( TQMouseEvent* );
58 
59 signals:
60  void pressed();
61 };
62 
63 //==============================================================================
64 /* some special events, see kmdidefines.h
65 */
66 //------------------------------------------------------------------------------
71 class KMDI_EXPORT KMdiChildFrmMoveEvent : public TQCustomEvent
72 {
73 public:
74  KMdiChildFrmMoveEvent( TQMoveEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_Move ) ), e ) {}
75 
76 };
77 
78 //------------------------------------------------------------------------------
83 class KMDI_EXPORT KMdiChildFrmDragBeginEvent : public TQCustomEvent
84 {
85 public:
86  KMdiChildFrmDragBeginEvent( TQMouseEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_DragBegin ) ), e ) {}
87 };
88 
89 //------------------------------------------------------------------------------
94 class KMDI_EXPORT KMdiChildFrmDragEndEvent : public TQCustomEvent
95 {
96 public:
97  KMdiChildFrmDragEndEvent( TQMouseEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_DragEnd ) ), e ) {}
98 };
99 
100 //------------------------------------------------------------------------------
105 class KMDI_EXPORT KMdiChildFrmResizeBeginEvent : public TQCustomEvent
106 {
107 public:
108  KMdiChildFrmResizeBeginEvent( TQMouseEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_ResizeBegin ) ), e ) {}
109 };
110 
111 //------------------------------------------------------------------------------
116 class KMDI_EXPORT KMdiChildFrmResizeEndEvent : public TQCustomEvent
117 {
118 public:
119  KMdiChildFrmResizeEndEvent( TQMouseEvent *e ) : TQCustomEvent( TQEvent::Type( TQEvent::User + int( KMdi::EV_ResizeEnd ) ), e ) {}
120 };
121 
122 
123 class KMdiChildFrmPrivate;
124 //==============================================================================
129 //------------------------------------------------------------------------------
130 class KMDI_EXPORT KMdiChildFrm : public TQFrame
131 {
132  friend class KMdiChildArea;
133  friend class KMdiChildFrmCaption;
134 
135  Q_OBJECT
136 
137  // attributes
138 public:
139  enum MdiWindowState { Normal, Maximized, Minimized };
140  //positions same in h and cpp for fast order check
141  KMdiChildView* m_pClient;
142 
143 protected:
144  KMdiChildArea* m_pManager;
145  KMdiChildFrmCaption* m_pCaption;
146  KMdiWin32IconButton* m_pWinIcon;
147  TQToolButton* m_pUnixIcon;
148  TQToolButton* m_pMinimize;
149  TQToolButton* m_pMaximize;
150  TQToolButton* m_pClose;
151  TQToolButton* m_pUndock;
152  MdiWindowState m_state;
153  TQRect m_restoredRect;
154  int m_iResizeCorner;
155  int m_iLastCursorCorner;
156  bool m_bResizing;
157  bool m_bDragging;
158  TQPixmap* m_pIconButtonPixmap;
159  TQPixmap* m_pMinButtonPixmap;
160  TQPixmap* m_pMaxButtonPixmap;
161  TQPixmap* m_pRestoreButtonPixmap;
162  TQPixmap* m_pCloseButtonPixmap;
163  TQPixmap* m_pUndockButtonPixmap;
164 
168  int m_windowMenuID;
169 
173  TQPopupMenu* m_pSystemMenu;
174 
175  TQSize m_oldClientMinSize;
176  TQSize m_oldClientMaxSize;
177  TQLayout::ResizeMode m_oldLayoutResizeMode;
178  TQTime m_timeMeasure;
179 
180  // methods
181 public:
182 
186  KMdiChildFrm( KMdiChildArea *parent );
187 
192  ~KMdiChildFrm();
193 
199  void setClient( KMdiChildView *w, bool bAutomaticResize = false );
200 
205  void unsetClient( TQPoint positionOffset = TQPoint( 0, 0 ) );
206 
210  void setIcon( const TQPixmap &pxm );
211 
215  TQPixmap* icon() const;
216 
220  void enableClose( bool bEnable );
221 
225  void setCaption( const TQString& text );
226 
230  const TQString& caption() { return m_pCaption->m_szCaption; }
231 
235  void setState( MdiWindowState state, bool bAnimate = true );
236 
240  inline MdiWindowState state() const { return m_state; }
241 
245  TQRect mdiAreaContentsRect() const;
246 
250  TQRect restoreGeometry() const;
251 
255  void setRestoreGeometry( const TQRect& newRestGeo );
256 
261  void updateRects() { resizeEvent( 0 ); }
262 
266  TQPopupMenu* systemMenu() const;
267 
271  inline int captionHeight() const { return m_pCaption->height(); }
272 
276  void redecorateButtons();
277 
281  bool isInDrag() const { return m_bDragging; }
282 
286  bool isInResize() const { return m_bResizing; }
287 
292  void raiseAndActivate();
293 
299  virtual void setMinimumSize ( int minw, int minh );
300 
301 public slots:
302 
303  void slot_resizeViaSystemMenu();
304 
305 protected:
306 
312  virtual void resizeEvent( TQResizeEvent * );
313 
319  virtual void mouseMoveEvent( TQMouseEvent *e );
320 
326  virtual void mousePressEvent( TQMouseEvent *e );
327 
332  virtual void mouseReleaseEvent( TQMouseEvent * );
333 
339  virtual void moveEvent( TQMoveEvent* me );
340 
344  virtual void leaveEvent( TQEvent * );
345 
352  virtual bool eventFilter( TQObject*, TQEvent* );
353 
358  void resizeWindow( int resizeCorner, int x, int y );
359 
363  void setResizeCursor( int resizeCorner );
364 
368  void unsetResizeCursor();
369 
374  virtual void switchToMinimizeLayout();
375 
379  void doResize();
380 
385  void doResize( bool captionOnly );
386 
387 protected slots:
388 
392  void maximizePressed();
393 
397  void restorePressed();
398 
402  void minimizePressed();
403 
407  void closePressed();
408 
412  void undockPressed();
413 
417  void showSystemMenu();
418 
419 protected:
420 
425  void linkChildren( TQDict<TQ_FocusPolicy>* pFocPolDict );
426 
431  TQDict<TQ_FocusPolicy>* unlinkChildren();
432 
438  int getResizeCorner( int ax, int ay );
439 
440 private:
441  KMdiChildFrmPrivate *d;
442 };
443 
444 #endif //_KMDICHILDFRM_H_
445 
446 // kate: space-indent off; replace-tabs off; tab-width 4; indent-mode csands;

kmdi

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

kmdi

Skip menu "kmdi"
  • 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 kmdi by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |