xref: /trunk/main/sw/source/ui/inc/uitool.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _UITOOL_HXX
28 #define _UITOOL_HXX
29 
30 #include <tools/wintypes.hxx>
31 #include <vcl/field.hxx>
32 #include <swtypes.hxx>
33 #include "swdllapi.h"
34 
35 class MetricFormatter;
36 class SfxItemSet;
37 class SfxMedium;
38 class SwPageDesc;
39 class SvxTabStopItem;
40 class SwWrtShell;
41 class ListBox;
42 class SwDocShell;
43 class SwFrmFmt;
44 class SwTabCols;
45 class DateTime;
46 class SfxViewFrame;
47 
48 // Umschalten einer Metric
49 SW_DLLPUBLIC void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit);
50 
51 // BoxInfoAttribut fuellen
52 SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
53 
54 // SfxItemSets <-> PageDesc
55 void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
56 void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet);
57 
58 // Auffuellen der Tabs mit DefaultTabs
59 SW_DLLPUBLIC void 	MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
60 
61 // DefaultTabs loeschen aus dem TabStopArray
62 //void 	EraseDefTabs(SvxTabStopItem& rTabs);
63 
64 // Abstand zwischen dem 1. und zweitem Element ermitteln
65 SW_DLLPUBLIC sal_uInt16 	GetTabDist(const SvxTabStopItem& rTabs);
66 
67 // erfrage ob im Set eine Sfx-PageDesc-Kombination vorliegt
68 // und setze diesen im Set und loesche die Transport Items
69 // (PageBreak & PageModel) aus dem Set
70 void SwToSfxPageDescAttr( SfxItemSet& rSet );
71 void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet );
72 
73 SW_DLLPUBLIC FieldUnit	GetDfltMetric(sal_Bool bWeb);
74 void		SetDfltMetric(FieldUnit	eMetric, sal_Bool bWeb);
75 
76 // ListBox mit allen Zeichenvorlagen fuellen - ausser Standard!
77 SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, sal_Bool bSorted = sal_False, sal_Bool bWithDefault = sal_False);
78 
79 //inserts a string sorted into a ListBox,
80 SW_DLLPUBLIC sal_uInt16 InsertStringSorted(const String& rEntry, ListBox& rToFill, sal_uInt16 nOffset);
81 
82 // Tabellenbreite und Ausrichtung ermitteln
83 SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent,
84 		SwWrtShell* pSh );
85 
86 String GetAppLangDateTimeString( const DateTime& );
87 
88 // search for a command string withing the menu structure and execute it
89 // at the dispatcher if there is one, if executed return true
90 bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId );
91 
92 #endif // _UITOOL_HXX
93