summaryrefslogtreecommitdiffstats
path: root/kpovmodeler/pmdockwidget_private.h
blob: 0bf8ebba9f18520ae0065f88e99db7c22b12195f (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/* This file is part of the KDE libraries
   Copyright (C) 2000 Max Judin <novaprint@mtu-net.ru>
   Modified 2002 Andreas Zehender <zehender@kde.org>

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

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
*/

/*
   IMPORTANT Note: This file compiles also in TQt-only mode by using the NO_KDE2 precompiler definition
*/

#ifndef KDOCKWIDGET_PRIVATE_H
#define KDOCKWIDGET_PRIVATE_H

#include <tqwidget.h>
#include <tqpushbutton.h>

#ifndef NO_KDE2
#include <netwm_def.h>
#endif

class TQFrame;

/**
 * Like TQSplitter but specially designed for dockwidgets stuff.
 * @internal
 *
 * @author Max Judin.
*/
class PMDockSplitter : public TQWidget
{
  TQ_OBJECT
  
public:
  PMDockSplitter(TQWidget *parent= 0, const char *name= 0, Qt::Orientation orient=Qt::Vertical, int pos= 50, bool highResolution=false);  
  virtual ~PMDockSplitter(){};

  void activate(TQWidget *c0, TQWidget *c1 = 0L);
  void deactivate();

  int separatorPos() const;
  void setSeparatorPos(int pos, bool do_resize = true);

  virtual bool eventFilter(TQObject *, TQEvent *);
  virtual bool event( TQEvent * );

  TQWidget* getFirst() const { return child0; }
  TQWidget* getLast() const { return child1; }
  TQWidget* getAnother( TQWidget* ) const;
  void updateName();

  void setOpaqueResize(bool b=true);
  bool opaqueResize() const;

  void setKeepSize(bool b=true);
  bool keepSize() const;

  void setHighResolution(bool b=true);
  bool highResolution() const;

   // MODIFICATION (Zehender)
   Qt::Orientation splitterOrientation( ) const { return orientation; }

protected:
  int checkValue( int ) const;
  virtual void resizeEvent(TQResizeEvent *);

private:
  void setupMinMaxSize();

  TQWidget *child0, *child1;
  Qt::Orientation orientation;
  bool initialised;
  TQFrame* divider;
  int xpos;
  bool mOpaqueResize, mKeepSize, mHighResolution;
};

/**
 * A mini-button usually placed in the dockpanel.
 * @internal
 *
 * @author Max Judin.
*/
class PMDockButton_Private : public TQPushButton
{
  TQ_OBJECT
  
public:
  PMDockButton_Private( TQWidget *parent=0, const char *name=0 );
  ~PMDockButton_Private();

protected:
  virtual void drawButton( TQPainter * );
  virtual void enterEvent( TQEvent * );
  virtual void leaveEvent( TQEvent * );

private:
  bool moveMouse;
};

/**
 * additional PMDockWidget stuff (private)
*/
class PMDockWidgetPrivate : public TQObject
{
  TQ_OBJECT
  
public:
  PMDockWidgetPrivate();
  ~PMDockWidgetPrivate();

public slots:
  /**
   * Especially used for Tab page docking. Switching the pages requires additional setFocus() for the embedded widget.
   */
  void slotFocusEmbeddedWidget(TQWidget* w = 0L);

public:
  int index;
  int splitPosInPercent;
  bool pendingFocusInEvent;
  bool blockHasUndockedSignal;

#ifndef NO_KDE2
  NET::WindowType windowType;
#endif

  TQWidget *_parent;
  bool transient;
};

#endif