| 1 |
/* AbiSource Application Framework |
| 2 |
* Copyright (C) 2005 Hubert Figuiere |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License |
| 6 |
* as published by the Free Software Foundation; either version 2 |
| 7 |
* of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 17 |
* 02110-1301 USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
|
| 21 |
#ifndef __XAP_WIDGET_H__ |
| 22 |
#define __XAP_WIDGET_H__ |
| 23 |
|
| 24 |
#include <string> |
| 25 |
|
| 26 |
#include "ut_types.h" |
| 27 |
|
| 28 |
class UT_UTF8String; |
| 29 |
|
| 30 |
|
| 31 |
/** virtual widget accessor. This class is pure virtual and |
| 32 |
must be verry lightweight |
| 33 |
*/ |
| 34 |
class ABI_EXPORT XAP_Widget |
| 35 |
{ |
| 36 |
protected: |
| 37 |
XAP_Widget() |
| 38 |
{ } |
| 39 |
|
| 40 |
public: |
| 41 |
/** The destructor just clean up. Must not destroy the real widget. */ |
| 42 |
virtual ~XAP_Widget() |
| 43 |
{ } |
| 44 |
|
| 45 |
/** set the widget enabled/disabled state */ |
| 46 |
virtual void setState(bool enabled) = 0; |
| 47 |
/** set the widget enabled/disabled state */ |
| 48 |
virtual bool getState(void) = 0; |
| 49 |
|
| 50 |
/** set the widget visible state */ |
| 51 |
virtual void setVisible(bool visible) = 0; |
| 52 |
/** get the widget visible state */ |
| 53 |
virtual bool getVisible(void) = 0; |
| 54 |
|
| 55 |
/** set the widget int value */ |
| 56 |
virtual void setValueInt(int val) = 0; |
| 57 |
/** get the widget int value */ |
| 58 |
virtual int getValueInt(void) = 0; |
| 59 |
|
| 60 |
/** set the widget value as string */ |
| 61 |
virtual void setValueString(const UT_UTF8String &val) = 0; |
| 62 |
/** get the widget value as string */ |
| 63 |
virtual void getValueString(UT_UTF8String &val) = 0; |
| 64 |
|
| 65 |
/** set the widget value as float */ |
| 66 |
virtual void setValueFloat(float val) = 0; |
| 67 |
/** get the widget value as float */ |
| 68 |
virtual float getValueFloat(void) = 0; |
| 69 |
|
| 70 |
/** set the widget label */ |
| 71 |
virtual void setLabel(const UT_UTF8String &val) = 0; |
| 72 |
virtual void setLabel(const std::string &val) = 0; |
| 73 |
}; |
| 74 |
|
| 75 |
|
| 76 |
#endif |