Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef DBAUI_TABLEFIELDDESCRIPTION_HXX
20 : #define DBAUI_TABLEFIELDDESCRIPTION_HXX
21 :
22 : #include <vcl/tabpage.hxx>
23 : #include "FieldDescGenWin.hxx"
24 : #include "IClipBoardTest.hxx"
25 :
26 : class FixedText;
27 : namespace dbaui
28 : {
29 : class OFieldDescGenWin;
30 : class OTableDesignHelpBar;
31 : class OFieldDescription;
32 : //==================================================================
33 : // Ableitung von TabPage ist ein Trick von TH,
34 : // um Aenderungen der Systemfarben zu bemerken
35 : class OTableFieldDescWin : public TabPage
36 : ,public IClipboardTest
37 : {
38 : enum ChildFocusState
39 : {
40 : DESCRIPTION,
41 : HELP,
42 : NONE
43 : };
44 : private:
45 : OTableDesignHelpBar* m_pHelpBar;
46 : OFieldDescGenWin* m_pGenPage;
47 : FixedText* m_pHeader;
48 : ChildFocusState m_eChildFocus;
49 :
50 : IClipboardTest* getActiveChild() const;
51 :
52 : protected:
53 : virtual void Resize();
54 : virtual void Paint( const Rectangle& rRect );
55 :
56 : public:
57 : OTableFieldDescWin( Window* pParent);
58 : virtual ~OTableFieldDescWin();
59 :
60 : virtual void Init();
61 :
62 : void DisplayData( OFieldDescription* pFieldDescr );
63 : void SaveData( OFieldDescription* pFieldDescr );
64 : void SetReadOnly( sal_Bool bReadOnly );
65 :
66 : // window overloads
67 : virtual long PreNotify( NotifyEvent& rNEvt );
68 : virtual void GetFocus();
69 : virtual void LoseFocus();
70 :
71 0 : void SetControlText( sal_uInt16 nControlId, const String& rText )
72 0 : { m_pGenPage->SetControlText(nControlId,rText); }
73 0 : String GetControlText( sal_uInt16 nControlId )
74 0 : { return m_pGenPage->GetControlText(nControlId); }
75 :
76 : // short GetFormatCategory(OFieldDescription* pFieldDescr) { return m_pGenPage ? m_pGenPage->GetFormatCategory(pFieldDescr) : -1; }
77 : // liefert zum am Feld eingestellten Format einen der CAT_xxx-Werte (CAT_NUMBER, CAT_DATE ...)
78 :
79 0 : String BoolStringPersistent(const String& rUIString) const { return m_pGenPage->BoolStringPersistent(rUIString); }
80 0 : String BoolStringUI(const String& rPersistentString) const { return m_pGenPage->BoolStringUI(rPersistentString); }
81 :
82 : // IClipboardTest
83 : virtual sal_Bool isCutAllowed();
84 : virtual sal_Bool isCopyAllowed();
85 : virtual sal_Bool isPasteAllowed();
86 0 : virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); }
87 :
88 : virtual void copy();
89 : virtual void cut();
90 : virtual void paste();
91 :
92 0 : inline OFieldDescGenWin* getGenPage() const { return m_pGenPage; }
93 0 : inline OTableDesignHelpBar* getHelpBar() const { return m_pHelpBar; }
94 :
95 : };
96 : }
97 : #endif // DBAUI_TABLEFIELDDESCRIPTION_HXX
98 :
99 :
100 :
101 :
102 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|