Branch data 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 : :
20 : : #ifndef ADDRCONT_HXX
21 : : #define ADDRCONT_HXX
22 : :
23 : : #include <com/sun/star/frame/XFrame.hpp>
24 : : #include <vcl/splitwin.hxx>
25 : : #include <vcl/timer.hxx>
26 : : #include "bibshortcuthandler.hxx"
27 : :
28 : : #include "bibmod.hxx"
29 : :
30 : : #define TOP_WINDOW 1
31 : : #define BOTTOM_WINDOW 2
32 : :
33 : : class BibDataManager;
34 : :
35 : : class BibWindowContainer : public BibWindow //Window
36 : : {
37 : : private:
38 : : // !BibShortCutHandler is also always a Window!
39 : : BibShortCutHandler* pChild;
40 : :
41 : : protected:
42 : : virtual void Resize();
43 : :
44 : : public:
45 : : BibWindowContainer( Window* pParent, BibShortCutHandler* pChild, WinBits nStyle = WB_3DLOOK);
46 : : ~BibWindowContainer();
47 : :
48 : : inline Window* GetChild();
49 : :
50 : : virtual void GetFocus();
51 : :
52 : : virtual sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent ); // returns true, if key was handled
53 : :
54 : : using Window::GetChild;
55 : : };
56 : :
57 : 0 : inline Window* BibWindowContainer::GetChild()
58 : : {
59 [ # # ]: 0 : return pChild? pChild->GetWindow() : NULL;
60 : : }
61 : :
62 : :
63 : : class BibBookContainer: public BibSplitWindow
64 : : {
65 : : private:
66 : :
67 : : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xTopFrameRef;
68 : : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xBottomFrameRef;
69 : :
70 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xTopPeerRef;
71 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xBottomPeerRef;
72 : :
73 : : BibDataManager* pDatMan;
74 : : BibWindowContainer* pTopWin;
75 : : BibWindowContainer* pBottomWin;
76 : : sal_Bool bFirstTime;
77 : : HdlBibModul pBibMod;
78 : : Timer aTimer;
79 : :
80 : : DECL_LINK( SplitHdl, Timer*);
81 : :
82 : : protected:
83 : :
84 : : virtual void Split();
85 : :
86 : : virtual long PreNotify( NotifyEvent& rNEvt );
87 : :
88 : : public:
89 : :
90 : : BibBookContainer(Window* pParent,BibDataManager*, WinBits nStyle = WB_3DLOOK );
91 : : ~BibBookContainer();
92 : :
93 : : inline BibWindow* GetTopWin() {return pTopWin;}
94 : : inline BibWindow* GetBottomWin() {return pBottomWin;}
95 : :
96 : : // !BibShortCutHandler is also always a Window!
97 : : void createTopFrame( BibShortCutHandler* pWin );
98 : :
99 : : void createBottomFrame( BibShortCutHandler* pWin );
100 : :
101 : : virtual void GetFocus();
102 : :
103 : : virtual sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent ); // returns true, if key was handled
104 : : };
105 : :
106 : : #endif
107 : :
108 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|