2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2014-06-03 10:01:18 +02:00
|
|
|
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
|
|
|
|
#define INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2010-11-23 18:41:04 +01:00
|
|
|
#include <tools/wintypes.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <vcl/field.hxx>
|
|
|
|
#include <swtypes.hxx>
|
2004-08-23 08:03:47 +00:00
|
|
|
#include "swdllapi.h"
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
class MetricFormatter;
|
|
|
|
class SfxItemSet;
|
|
|
|
class SwPageDesc;
|
|
|
|
class SvxTabStopItem;
|
|
|
|
class SwWrtShell;
|
|
|
|
class ListBox;
|
|
|
|
class SwDocShell;
|
2015-05-20 13:05:49 +02:00
|
|
|
class SwFrameFormat;
|
2000-09-18 16:15:01 +00:00
|
|
|
class SwTabCols;
|
2001-02-14 08:58:47 +00:00
|
|
|
class DateTime;
|
2006-02-10 07:49:30 +00:00
|
|
|
class SfxViewFrame;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-04-21 21:52:58 +02:00
|
|
|
// switch a metric
|
2004-08-23 08:03:47 +00:00
|
|
|
SW_DLLPUBLIC void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-09-09 15:13:31 +02:00
|
|
|
// fill BoxInfo attribute
|
2004-08-23 08:03:47 +00:00
|
|
|
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-08-07 12:01:24 +02:00
|
|
|
// Modes for attribute conversion
|
|
|
|
#define CONV_ATTR_STD 1 // Standard character dialog
|
|
|
|
#define CONV_ATTR_ENV 2 // Character dialog opened from envelope dialog
|
|
|
|
|
2013-09-09 15:13:31 +02:00
|
|
|
/**
|
|
|
|
* Convert character specific attributes to general ones used by tab pages.
|
|
|
|
*
|
2013-10-06 21:08:04 +02:00
|
|
|
* @param[in,out] rSet the set in which character attributes are stored
|
2013-09-09 15:13:31 +02:00
|
|
|
* @param[in] nMode specify the dialog which will be called after conversion
|
|
|
|
**/
|
|
|
|
SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode);
|
2013-08-07 12:01:24 +02:00
|
|
|
|
2013-09-09 15:13:31 +02:00
|
|
|
/**
|
|
|
|
* Convert general attributes to the corresponding character attributes.
|
|
|
|
* This method is used after executed a character dialog.
|
|
|
|
*
|
2013-10-06 21:08:04 +02:00
|
|
|
* @param[in,out] rSet the set in which character attributes are stored
|
2015-03-18 15:19:46 +01:00
|
|
|
* @param[in] rOrigSet original itemset used as input for the dialog
|
2013-09-09 15:13:31 +02:00
|
|
|
* @param[in] nMode specify the dialog which was called before
|
|
|
|
**/
|
2015-03-18 15:19:46 +01:00
|
|
|
SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, const sal_uInt8 nMode);
|
2013-08-07 12:01:24 +02:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
// SfxItemSets <-> PageDesc
|
2001-04-12 07:26:15 +00:00
|
|
|
void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
|
2000-09-18 16:15:01 +00:00
|
|
|
void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet);
|
|
|
|
|
2011-04-21 21:52:58 +02:00
|
|
|
// fill tabs with default tabs
|
2004-08-23 08:03:47 +00:00
|
|
|
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-04-21 21:52:58 +02:00
|
|
|
// erase DefaultTabs from TabStopArray
|
2000-09-18 16:15:01 +00:00
|
|
|
//void EraseDefTabs(SvxTabStopItem& rTabs);
|
|
|
|
|
2011-04-21 21:52:58 +02:00
|
|
|
// determine space between 1st and 2nd element
|
2014-06-28 10:37:21 +02:00
|
|
|
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem& rTabs);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-04-21 21:52:58 +02:00
|
|
|
// determine whether a Sfx-PageDesc combination exists in the set
|
|
|
|
// and set this in the set and delete the transport items
|
|
|
|
// (PageBreak & PageModel) from the set
|
2000-09-18 16:15:01 +00:00
|
|
|
void SwToSfxPageDescAttr( SfxItemSet& rSet );
|
|
|
|
void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet );
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb);
|
|
|
|
void SetDfltMetric(FieldUnit eMetric, bool bWeb);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
SW_DLLPUBLIC bool HasCharUnit( bool bWeb );
|
|
|
|
void SetApplyCharUnit(bool bApplyChar, bool bWeb);
|
2010-09-13 14:37:51 +02:00
|
|
|
|
2014-06-12 10:13:22 +02:00
|
|
|
// fill ListBox with all char style templates, except the standard ones
|
2013-02-25 10:56:06 +09:00
|
|
|
SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, bool bSorted = false, bool bWithDefault = false);
|
2004-08-23 08:03:47 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
//inserts a string sorted into a ListBox,
|
2014-03-26 22:59:46 +01:00
|
|
|
SW_DLLPUBLIC sal_Int32 InsertStringSorted(const OUString& rEntry, ListBox& rToFill, sal_Int32 nOffset);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-01-07 23:18:26 +01:00
|
|
|
// Get table width and alignement
|
2015-05-20 13:05:49 +02:00
|
|
|
SwTwips GetTableWidth( SwFrameFormat* pFormat, SwTabCols& rCols, sal_uInt16 *pPercent,
|
2000-09-18 16:15:01 +00:00
|
|
|
SwWrtShell* pSh );
|
|
|
|
|
2013-10-08 14:15:04 +02:00
|
|
|
OUString GetAppLangDateTimeString( const DateTime& );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-11-10 15:05:25 +01:00
|
|
|
// search for a command string within the menu structure and execute it
|
2006-02-10 07:49:30 +00:00
|
|
|
// at the dispatcher if there is one, if executed return true
|
2011-01-17 15:06:54 +01:00
|
|
|
bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId );
|
2006-02-10 07:49:30 +00:00
|
|
|
|
2014-06-03 10:01:18 +02:00
|
|
|
#endif // INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|