Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / include / formula / funcutl.hxx
blob18e94ab20a4d7c59ab2fd5e2b016f70b4a19cf59
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_FORMULA_FUNCUTL_HXX
21 #define INCLUDED_FORMULA_FUNCUTL_HXX
23 #include <vcl/fixed.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/edit.hxx>
26 #include <formula/formuladllapi.h>
28 namespace formula {
30 class IControlReferenceHandler;
32 class FORMULA_DLLPUBLIC RefEdit : public Edit
34 private:
35 Timer aTimer;
36 IControlReferenceHandler* pAnyRefDlg; // parent dialog
37 Window* pLabelWidget;
39 DECL_LINK( UpdateHdl, void* );
41 protected:
42 virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
43 virtual void GetFocus() SAL_OVERRIDE;
44 virtual void LoseFocus() SAL_OVERRIDE;
46 public:
47 RefEdit( Window* _pParent,IControlReferenceHandler* pParent, Window* pShrinkModeLabel, const ResId& rResId );
48 RefEdit( Window* _pParent, Window* pShrinkModeLabel, WinBits nStyle = WB_BORDER );
50 virtual ~RefEdit();
52 void SetRefString( const OUString& rStr );
54 /**
55 * Flag reference valid or invalid, which in turn changes the visual
56 * appearance of the control accordingly.
58 void SetRefValid(bool bValid);
60 using Edit::SetText;
62 void SetText( const OUString& rStr ) SAL_OVERRIDE;
63 virtual void Modify() SAL_OVERRIDE;
65 void StartUpdateData();
67 void SetReferences( IControlReferenceHandler* pDlg, Window *pLabelWidget );
69 IControlReferenceHandler* GetRefDialog()
71 return pAnyRefDlg;
74 Window* GetLabelWidgetForShrinkMode()
76 return pLabelWidget;
81 class FORMULA_DLLPUBLIC RefButton : public ImageButton
83 private:
84 Image aImgRefStart; // Start reference input
85 Image aImgRefDone; // Stop reference input
86 OUString aShrinkQuickHelp;
87 OUString aExpandQuickHelp;
88 IControlReferenceHandler* pAnyRefDlg; // parent dialog
89 RefEdit* pRefEdit; // zugeordnetes Edit-Control
91 protected:
92 virtual void Click() SAL_OVERRIDE;
93 virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
94 virtual void GetFocus() SAL_OVERRIDE;
95 virtual void LoseFocus() SAL_OVERRIDE;
97 public:
98 RefButton(Window* _pParent, const ResId& rResId);
99 RefButton(Window* _pParent, WinBits nStyle = 0);
100 RefButton(Window* _pParent, const ResId& rResId,
101 RefEdit* pEdit, IControlReferenceHandler* pDlg);
103 void SetReferences( IControlReferenceHandler* pDlg, RefEdit* pEdit );
105 void SetStartImage();
106 void SetEndImage();
107 void DoRef()
109 Click();
113 } // formula
115 #endif // INCLUDED_FORMULA_FUNCUTL_HXX
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */