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