xref: /trunk/main/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBAUI_TABLEFIELDDESCGENPAGE_HXX
28 #define DBAUI_TABLEFIELDDESCGENPAGE_HXX
29 
30 #ifndef _SV_TABPAGE_HXX
31 #include <vcl/tabpage.hxx>
32 #endif
33 #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX
34 #include "IClipBoardTest.hxx"
35 #endif
36 
37 namespace dbaui
38 {
39     class OTableDesignHelpBar;
40     class OFieldDescription;
41     class OTableFieldControl;
42     class OTableEditorCtrl;
43     //==================================================================
44     class OFieldDescGenWin : public TabPage
45                             ,public IClipboardTest
46     {
47 
48         OTableFieldControl  *m_pFieldControl;
49     protected:
50         virtual void Resize();
51 
52     public:
53         OFieldDescGenWin( Window* pParent, OTableDesignHelpBar* pHelpBar );
54         virtual ~OFieldDescGenWin();
55 
56         virtual void GetFocus();
57         virtual void LoseFocus();
58         virtual void Init();
59 
60         void DisplayData( OFieldDescription* pFieldDescr );
61         void SaveData( OFieldDescription* pFieldDescr );
62         void SetControlText( sal_uInt16 nControlId, const String& rText );
63         String GetControlText( sal_uInt16 nControlId );
64         void SetReadOnly( sal_Bool bReadOnly );
65 #if OSL_DEBUG_LEVEL > 0
66         OTableEditorCtrl* GetEditorCtrl();
67 #endif
68         //  short GetFormatCategory(OFieldDescription* pFieldDescr);
69             // liefert zum am Feld eingestellten Format einen der CAT_xxx-Werte (CAT_NUMBER, CAT_DATE ...)
70 
71         String BoolStringPersistent(const String& rUIString) const;
72         String BoolStringUI(const String& rPersistentString) const;
73 
74         // IClipboardTest
75         virtual sal_Bool isCutAllowed();
76         virtual sal_Bool isCopyAllowed();
77         virtual sal_Bool isPasteAllowed();
78         virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); }
79 
80         virtual void copy();
81         virtual void cut();
82         virtual void paste();
83 
84         inline OTableFieldControl*  getFieldControl() const { return m_pFieldControl; }
85     };
86 }
87 #endif // DBAUI_TABLEFIELDDESCGENPAGE_HXX
88 
89