xref: /trunk/main/sw/source/ui/inc/basesh.hxx (revision 24297db34623acd4ed3cd634e301c7c8a91fabbc)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef _SWBASESH_HXX
23 #define _SWBASESH_HXX
24 
25 #include <shellid.hxx>
26 
27 #define _SVSTDARR_USHORTSSORT
28 #define _SVSTDARR_USHORTS
29 #include <tools/link.hxx>
30 #include <vcl/timer.hxx>
31 #include <sfx2/module.hxx>
32 #include <sfx2/shell.hxx>
33 #include <svl/svstdarr.hxx>
34 
35 #include <mdiexp.hxx>
36 
37 class SwWrtShell;
38 class SwCrsrShell;
39 class SwView;
40 class SfxItemSet;
41 class Graphic;
42 
43 struct DBTextStruct_Impl;
44 class SwBaseShell: public SfxShell
45 {
46     SwView      &rView;
47 
48     // DragModus
49     static FlyMode eFrameMode;
50 
51     // Bug 75078 - if in GetState the asynch call of GetGraphic returns
52     //              synch, the set the state directly into the itemset
53     SfxItemSet*         pGetStateSet;
54 
55     //Update-Timer fuer Graphic
56     SvUShortsSort aGrfUpdateSlots;
57 
58     DECL_LINK( GraphicArrivedHdl, SwCrsrShell* );
59 
60 protected:
61     SwWrtShell&         GetShell();
62     SwWrtShell*         GetShellPtr();
63 
64     inline SwView&      GetView()                       { return rView; }
65     inline void         SetGetStateSet( SfxItemSet* p ) { pGetStateSet = p; }
66     inline sal_Bool         AddGrfUpdateSlot( sal_uInt16 nSlot ){ return aGrfUpdateSlots.Insert( nSlot ); }
67 
68     DECL_STATIC_LINK(   SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl* );
69 
70     void                InsertURLButton( const String& rURL, const String& rTarget, const String& rTxt );
71     void                InsertTable( SfxRequest& _rRequest );
72 
73 public:
74     SwBaseShell(SwView &rShell);
75     virtual     ~SwBaseShell();
76 
77     SFX_DECL_INTERFACE(SW_BASESHELL)
78     TYPEINFO();
79 
80     void        ExecDelete(SfxRequest &);
81 
82     void        ExecClpbrd(SfxRequest &);
83     void        StateClpbrd(SfxItemSet &);
84 
85     void        ExecUndo(SfxRequest &);
86     void        StateUndo(SfxItemSet &);
87 
88     void        Execute(SfxRequest &);
89     void        GetState(SfxItemSet &);
90     void        StateStyle(SfxItemSet &);
91 
92     void        ExecuteGallery(SfxRequest&);
93     void        GetGalleryState(SfxItemSet&);
94 
95     void        ExecDlg(SfxRequest &);
96 
97     void        StateStatusLine(SfxItemSet &rSet);
98     void        ExecTxtCtrl(SfxRequest& rReq);
99     void        GetTxtFontCtrlState(SfxItemSet& rSet);
100     void        GetTxtCtrlState(SfxItemSet& rSet);
101     void        GetBorderState(SfxItemSet &rSet);
102     void        GetBckColState(SfxItemSet &rSet);
103 
104     void        ExecBckCol(SfxRequest& rReq);
105     void        SetWrapMode( sal_uInt16 nSlot );
106 
107     void        StateDisableItems(SfxItemSet &);
108 
109     void        EditRegionDialog(SfxRequest& rReq);
110     void        InsertRegionDialog(SfxRequest& rReq);
111 
112     void        ExecField(SfxRequest& rReq);
113 
114     static void    SetFrmMode( FlyMode eMode, SwWrtShell *pShell ); //Mit Update!
115     static void   _SetFrmMode( FlyMode eMode )   { eFrameMode = eMode; }
116     static FlyMode  GetFrmMode()                 { return eFrameMode; }
117 
118 };
119 
120 #endif
121 
122 /* vim: set noet sw=4 ts=4: */
123