xref: /aoo42x/main/sw/source/ui/inc/uitool.hxx (revision 86e1cf34)
11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51d2dbeb0SAndrew Rist  * distributed with this work for additional information
61d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
101d2dbeb0SAndrew Rist  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
121d2dbeb0SAndrew Rist  *
131d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
171d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist  * under the License.
191d2dbeb0SAndrew Rist  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _UITOOL_HXX
24cdf0e10cSrcweir #define _UITOOL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <tools/wintypes.hxx>
27cdf0e10cSrcweir #include <vcl/field.hxx>
28cdf0e10cSrcweir #include <swtypes.hxx>
29cdf0e10cSrcweir #include "swdllapi.h"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class MetricFormatter;
32cdf0e10cSrcweir class SfxItemSet;
33cdf0e10cSrcweir class SfxMedium;
34cdf0e10cSrcweir class SwPageDesc;
35cdf0e10cSrcweir class SvxTabStopItem;
36cdf0e10cSrcweir class SwWrtShell;
37cdf0e10cSrcweir class ListBox;
38cdf0e10cSrcweir class SwDocShell;
39cdf0e10cSrcweir class SwFrmFmt;
40cdf0e10cSrcweir class SwTabCols;
41cdf0e10cSrcweir class DateTime;
42cdf0e10cSrcweir class SfxViewFrame;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir // Umschalten einer Metric
45cdf0e10cSrcweir SW_DLLPUBLIC void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit);
46cdf0e10cSrcweir 
47cdf0e10cSrcweir // BoxInfoAttribut fuellen
48cdf0e10cSrcweir SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
49cdf0e10cSrcweir 
50cdf0e10cSrcweir // SfxItemSets <-> PageDesc
51cdf0e10cSrcweir void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
52cdf0e10cSrcweir void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet);
53cdf0e10cSrcweir 
54cdf0e10cSrcweir // Auffuellen der Tabs mit DefaultTabs
55cdf0e10cSrcweir SW_DLLPUBLIC void 	MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
56cdf0e10cSrcweir 
57cdf0e10cSrcweir // DefaultTabs loeschen aus dem TabStopArray
58cdf0e10cSrcweir //void 	EraseDefTabs(SvxTabStopItem& rTabs);
59cdf0e10cSrcweir 
60cdf0e10cSrcweir // Abstand zwischen dem 1. und zweitem Element ermitteln
61cdf0e10cSrcweir SW_DLLPUBLIC sal_uInt16 	GetTabDist(const SvxTabStopItem& rTabs);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir // erfrage ob im Set eine Sfx-PageDesc-Kombination vorliegt
64cdf0e10cSrcweir // und setze diesen im Set und loesche die Transport Items
65cdf0e10cSrcweir // (PageBreak & PageModel) aus dem Set
66cdf0e10cSrcweir void SwToSfxPageDescAttr( SfxItemSet& rSet );
67cdf0e10cSrcweir void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet );
68cdf0e10cSrcweir 
69cdf0e10cSrcweir SW_DLLPUBLIC FieldUnit	GetDfltMetric(sal_Bool bWeb);
70cdf0e10cSrcweir void		SetDfltMetric(FieldUnit	eMetric, sal_Bool bWeb);
71cdf0e10cSrcweir 
72cdf0e10cSrcweir // ListBox mit allen Zeichenvorlagen fuellen - ausser Standard!
73cdf0e10cSrcweir SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, sal_Bool bSorted = sal_False, sal_Bool bWithDefault = sal_False);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir //inserts a string sorted into a ListBox,
76cdf0e10cSrcweir SW_DLLPUBLIC sal_uInt16 InsertStringSorted(const String& rEntry, ListBox& rToFill, sal_uInt16 nOffset);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir // Tabellenbreite und Ausrichtung ermitteln
79cdf0e10cSrcweir SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent,
80cdf0e10cSrcweir 		SwWrtShell* pSh );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir String GetAppLangDateTimeString( const DateTime& );
83cdf0e10cSrcweir 
84*86e1cf34SPedro Giffuni // search for a command string within the menu structure and execute it
85cdf0e10cSrcweir // at the dispatcher if there is one, if executed return true
86cdf0e10cSrcweir bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #endif // _UITOOL_HXX
89