update dev300-m58
[ooovba.git] / dbaccess / source / ui / tabledesign / TableFieldDescWin.hxx
blobb251b0f5bf4b406e350aeda57d26f3c638481821
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TableFieldDescWin.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_TABLEFIELDDESCRIPTION_HXX
31 #define DBAUI_TABLEFIELDDESCRIPTION_HXX
33 #ifndef _SV_TABPAGE_HXX
34 #include <vcl/tabpage.hxx>
35 #endif
36 #ifndef DBAUI_TABLEFIELDDESCGENPAGE_HXX
37 #include "FieldDescGenWin.hxx"
38 #endif
39 #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX
40 #include "IClipBoardTest.hxx"
41 #endif
43 class FixedText;
44 namespace dbaui
46 class OFieldDescGenWin;
47 class OTableDesignHelpBar;
48 class OFieldDescription;
49 //==================================================================
50 // Ableitung von TabPage ist ein Trick von TH,
51 // um Aenderungen der Systemfarben zu bemerken (Bug #53905)
52 class OTableFieldDescWin : public TabPage
53 ,public IClipboardTest
55 enum ChildFocusState
57 DESCRIPTION,
58 HELP,
59 NONE
61 private:
62 OTableDesignHelpBar* m_pHelpBar;
63 OFieldDescGenWin* m_pGenPage;
64 FixedText* m_pHeader;
65 ChildFocusState m_eChildFocus;
67 IClipboardTest* getActiveChild() const;
69 protected:
70 virtual void Resize();
71 virtual void Paint( const Rectangle& rRect );
73 public:
74 OTableFieldDescWin( Window* pParent);
75 virtual ~OTableFieldDescWin();
77 virtual void Init();
79 void DisplayData( OFieldDescription* pFieldDescr );
80 void SaveData( OFieldDescription* pFieldDescr );
81 void SetReadOnly( BOOL bReadOnly );
83 // window overloads
84 virtual long PreNotify( NotifyEvent& rNEvt );
85 virtual void GetFocus();
86 virtual void LoseFocus();
88 void SetControlText( USHORT nControlId, const String& rText )
89 { m_pGenPage->SetControlText(nControlId,rText); }
90 String GetControlText( USHORT nControlId )
91 { return m_pGenPage->GetControlText(nControlId); }
93 // short GetFormatCategory(OFieldDescription* pFieldDescr) { return m_pGenPage ? m_pGenPage->GetFormatCategory(pFieldDescr) : -1; }
94 // liefert zum am Feld eingestellten Format einen der CAT_xxx-Werte (CAT_NUMBER, CAT_DATE ...)
96 String BoolStringPersistent(const String& rUIString) const { return m_pGenPage->BoolStringPersistent(rUIString); }
97 String BoolStringUI(const String& rPersistentString) const { return m_pGenPage->BoolStringUI(rPersistentString); }
99 // IClipboardTest
100 virtual sal_Bool isCutAllowed();
101 virtual sal_Bool isCopyAllowed();
102 virtual sal_Bool isPasteAllowed();
103 virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); }
105 virtual void copy();
106 virtual void cut();
107 virtual void paste();
109 inline OFieldDescGenWin* getGenPage() const { return m_pGenPage; }
110 inline OTableDesignHelpBar* getHelpBar() const { return m_pHelpBar; }
114 #endif // DBAUI_TABLEFIELDDESCRIPTION_HXX