xref: /trunk/main/sw/source/ui/inc/uitool.hxx (revision 86e1cf34)
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 
23 #ifndef _UITOOL_HXX
24 #define _UITOOL_HXX
25 
26 #include <tools/wintypes.hxx>
27 #include <vcl/field.hxx>
28 #include <swtypes.hxx>
29 #include "swdllapi.h"
30 
31 class MetricFormatter;
32 class SfxItemSet;
33 class SfxMedium;
34 class SwPageDesc;
35 class SvxTabStopItem;
36 class SwWrtShell;
37 class ListBox;
38 class SwDocShell;
39 class SwFrmFmt;
40 class SwTabCols;
41 class DateTime;
42 class SfxViewFrame;
43 
44 // Umschalten einer Metric
45 SW_DLLPUBLIC void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit);
46 
47 // BoxInfoAttribut fuellen
48 SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
49 
50 // SfxItemSets <-> PageDesc
51 void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
52 void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet);
53 
54 // Auffuellen der Tabs mit DefaultTabs
55 SW_DLLPUBLIC void 	MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
56 
57 // DefaultTabs loeschen aus dem TabStopArray
58 //void 	EraseDefTabs(SvxTabStopItem& rTabs);
59 
60 // Abstand zwischen dem 1. und zweitem Element ermitteln
61 SW_DLLPUBLIC sal_uInt16 	GetTabDist(const SvxTabStopItem& rTabs);
62 
63 // erfrage ob im Set eine Sfx-PageDesc-Kombination vorliegt
64 // und setze diesen im Set und loesche die Transport Items
65 // (PageBreak & PageModel) aus dem Set
66 void SwToSfxPageDescAttr( SfxItemSet& rSet );
67 void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet );
68 
69 SW_DLLPUBLIC FieldUnit	GetDfltMetric(sal_Bool bWeb);
70 void		SetDfltMetric(FieldUnit	eMetric, sal_Bool bWeb);
71 
72 // ListBox mit allen Zeichenvorlagen fuellen - ausser Standard!
73 SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, sal_Bool bSorted = sal_False, sal_Bool bWithDefault = sal_False);
74 
75 //inserts a string sorted into a ListBox,
76 SW_DLLPUBLIC sal_uInt16 InsertStringSorted(const String& rEntry, ListBox& rToFill, sal_uInt16 nOffset);
77 
78 // Tabellenbreite und Ausrichtung ermitteln
79 SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent,
80 		SwWrtShell* pSh );
81 
82 String GetAppLangDateTimeString( const DateTime& );
83 
84 // search for a command string within the menu structure and execute it
85 // at the dispatcher if there is one, if executed return true
86 bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId );
87 
88 #endif // _UITOOL_HXX
89