bump product version to 4.1.6.2
[LibreOffice.git] / include / formula / funcutl.hxx
blob6676117cdf204baf01df8918682d26e63967d4b6
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 FORMULA_FUNCUTL_HXX
21 #define 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 );
43 virtual void GetFocus();
44 virtual void LoseFocus();
46 public:
47 RefEdit( Window* _pParent,IControlReferenceHandler* pParent,
48 Window* pShrinkModeLabel, const ResId& rResId );
49 RefEdit( Window* _pParent, Window* pShrinkModeLabel,
50 WinBits nStyle = WB_BORDER );
51 virtual ~RefEdit();
53 void SetRefString( const XubString& rStr );
55 /**
56 * Flag reference valid or invalid, which in turn changes the visual
57 * appearance of the control accordingly.
59 void SetRefValid(bool bValid);
61 using Edit::SetText;
62 virtual void SetText( const XubString& rStr );
63 virtual void Modify();
65 void StartUpdateData();
67 void SetReferences( IControlReferenceHandler* pDlg, Window *pLabelWidget );
68 IControlReferenceHandler* GetRefDialog() { return pAnyRefDlg; }
69 Window* GetLabelWidgetForShrinkMode() { return pLabelWidget; }
73 //============================================================================
75 class FORMULA_DLLPUBLIC RefButton : public ImageButton
77 private:
78 Image aImgRefStart; /// Start reference input
79 Image aImgRefDone; /// Stop reference input
80 OUString aShrinkQuickHelp;
81 OUString aExpandQuickHelp;
82 IControlReferenceHandler* pAnyRefDlg; // parent dialog
83 RefEdit* pRefEdit; // zugeordnetes Edit-Control
85 protected:
86 virtual void Click();
87 virtual void KeyInput( const KeyEvent& rKEvt );
88 virtual void GetFocus();
89 virtual void LoseFocus();
91 public:
92 RefButton(Window* _pParent, const ResId& rResId);
93 RefButton(Window* _pParent, WinBits nStyle = 0);
94 RefButton(Window* _pParent, const ResId& rResId,
95 RefEdit* pEdit, IControlReferenceHandler* pDlg);
97 void SetReferences( IControlReferenceHandler* pDlg,
98 RefEdit* pEdit );
100 void SetStartImage();
101 void SetEndImage();
102 void DoRef() { Click(); }
105 } // formula
107 #endif // FORMULA_FUNCUTL_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */