~ubuntu-branches/ubuntu/edgy/koffice/edgy-updates

« back to all changes in this revision

Viewing changes to kontour/UnitBox.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040509113300-xi5t1z4yxe7n03x7
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- C++ -*-
2
 
 
3
 
  $Id: UnitBox.h,v 1.9 2000/08/31 11:17:01 wtrobin Exp $
4
 
 
5
 
  This file is part of KIllustrator.
6
 
  Copyright (C) 1998 Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de)
7
 
 
8
 
  This program is free software; you can redistribute it and/or modify
9
 
  it under the terms of the GNU Library General Public License as
10
 
  published by
11
 
  the Free Software Foundation; either version 2 of the License, or
12
 
  (at your option) any later version.
13
 
 
14
 
  This program is distributed in the hope that it will be useful,
15
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
  GNU General Public License for more details.
18
 
 
19
 
  You should have received a copy of the GNU Library General Public License
20
 
  along with this program; if not, write to the Free Software
21
 
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
 
 
23
 
*/
24
 
 
25
 
#ifndef UnitBox_h_
26
 
#define UnitBox_h_
27
 
 
28
 
#include <qhbox.h>
29
 
#include <units.h>
30
 
 
31
 
class QComboBox;
32
 
class KDoubleNumInput;
33
 
 
34
 
class UnitBox : public QHBox {
35
 
  Q_OBJECT
36
 
public:
37
 
  UnitBox (QWidget* parent = 0L, const char* name = 0L);
38
 
  ~UnitBox ();
39
 
 
40
 
  void setFormatString (const char* fmt);
41
 
 
42
 
  float getValue ();
43
 
  void setValue (float value);
44
 
 
45
 
  void setStep (float step);
46
 
  float getStep () const;
47
 
 
48
 
  void setRange (float minVal, float maxVal);
49
 
  void getRange (float& minVal, float& maxVal);
50
 
 
51
 
  void setEditable (bool);
52
 
  void enableUnits (bool flag);
53
 
 
54
 
  static void setDefaultMeasurementUnit (MeasurementUnit unit);
55
 
 
56
 
signals:
57
 
  void valueChanged (float val);
58
 
 
59
 
protected slots:
60
 
  void unitChanged (int id);
61
 
  void slotValueChanged(double f);
62
 
 
63
 
private:
64
 
  KDoubleNumInput *valueBox;
65
 
  bool isUnitEnabled;
66
 
  QComboBox *unitCombo;
67
 
  MeasurementUnit unit;
68
 
  float ptMinVal, ptMaxVal; // the minimal and maximal value in points
69
 
  float m_step;
70
 
 
71
 
  static MeasurementUnit defaultUnit;
72
 
};
73
 
 
74
 
#endif