office-gobmx/cui/source/inc/autocdlg.hxx

516 lines
16 KiB
C++
Raw Normal View History

2010-10-27 06:45:03 -05:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: clarify Option->Language UI option Patch contributed by Herbert Duerr http://svn.apache.org/viewvc?view=revision&revision=1173991 cws mba34issues01: #i117712#: fix several resource errors introduced by IAccessible2 implementation Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1173991 cws mba34issues01: #i117709#: add missing string resource Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1172348 cws mba34issues01: #i117716#: fix missing resources my removing unused code Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1172345 re-add Crystal, Tango, Oxygen icon theme listings. correct method signature Patch contributed by Jean-Louis 'Hans' Fuchs http://svn.apache.org/viewvc?view=revision&revision=1306725 i#119063 - correct serf integration Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1300521 i#119036 - adapt serf integration -- use transfer-encoding 'chunked' on HTTPS -- switch transfer-encoding between 'chunked' and none on 413 HTTP status code -- refactoring -- improve user experience of certification dialog - only shown once Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1299727 118569: Use whole certification chain for verification. Patch contributed by Andre Fischer http://svn.apache.org/viewvc?view=revision&revision=1295493 serf integration: improve credential input handling Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1294557 warning-free ucb/source/ucp/webdav Patch contributed by Pavel Janik http://svn.apache.org/viewvc?view=revision&revision=1294086 some refactoring to PROPPATCH and PROPFIND requests Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1293281 i#118569: Replace neon with serf Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1292832 http://svn.apache.org/viewvc?view=revision&revision=1292794 remove OS/2 conditionals for now. re-enable webdav unit tests.
2012-10-04 05:25:41 -05: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 .
*/
#ifndef INCLUDED_CUI_SOURCE_INC_AUTOCDLG_HXX
#define INCLUDED_CUI_SOURCE_INC_AUTOCDLG_HXX
2009-10-30 18:36:06 -05:00
#include <sfx2/tabdlg.hxx>
#include <svtools/langtab.hxx>
#include <svtools/simptabl.hxx>
#include <svtools/svtabbx.hxx>
#include <svtools/treelistentry.hxx>
2009-10-30 18:36:06 -05:00
#include <svx/checklbx.hxx>
#include <svx/langbox.hxx>
#include <vcl/button.hxx>
2009-10-30 18:36:06 -05:00
#include <vcl/fixed.hxx>
#include <vcl/field.hxx>
#include <vcl/group.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/metric.hxx>
2009-10-30 18:36:06 -05:00
class CharClass;
class CollatorWrapper;
class SmartTagMgr;
namespace editeng { class SortedAutoCompleteStrings; }
2009-10-30 18:36:06 -05:00
// class OfaAutoCorrDlg --------------------------------------------------
class OfaAutoCorrDlg : public SfxTabDialog
{
VclContainer* m_pLanguageBox;
SvxLanguageBox* m_pLanguageLB;
sal_uInt16 m_nReplacePageId;
sal_uInt16 m_nExceptionsPageId;
2009-10-30 18:36:06 -05:00
DECL_LINK(SelectLanguageHdl, ListBox*);
public:
OfaAutoCorrDlg(Window* pParent, const SfxItemSet *pSet);
2009-10-30 18:36:06 -05:00
void EnableLanguage(bool bEnable);
2009-10-30 18:36:06 -05:00
};
// class OfaACorrCheckListBox ------------------------------------------
class OfaACorrCheckListBox : public SvSimpleTable
2009-10-30 18:36:06 -05:00
{
using SvSimpleTable::SetTabs;
2009-10-30 18:36:06 -05:00
using SvTreeListBox::GetCheckButtonState;
using SvTreeListBox::SetCheckButtonState;
protected:
virtual void SetTabs();
virtual void HBarClick();
virtual void KeyInput( const KeyEvent& rKEvt );
public:
OfaACorrCheckListBox(SvSimpleTableContainer& rParent, WinBits nBits = WB_BORDER)
: SvSimpleTable(rParent, nBits)
{
}
2009-10-30 18:36:06 -05:00
inline void *GetUserData(sal_uLong nPos) { return GetEntry(nPos)->GetUserData(); }
inline void SetUserData(sal_uLong nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); }
inline sal_uLong GetSelectEntryPos() { return GetModel()->GetAbsPos(FirstSelected()); }
2009-10-30 18:36:06 -05:00
sal_Bool IsChecked(sal_uLong nPos, sal_uInt16 nCol = 0);
void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked);
SvButtonState GetCheckButtonState( SvTreeListEntry*, sal_uInt16 nCol ) const;
void SetCheckButtonState( SvTreeListEntry*, sal_uInt16 nCol, SvButtonState );
2009-10-30 18:36:06 -05:00
};
// class OfaAutocorrOptionsPage ------------------------------------------
class OfaAutocorrOptionsPage : public SfxTabPage
{
using TabPage::ActivatePage;
private:
SvxCheckListBox *m_pCheckLB;
OUString m_sInput;
OUString m_sDoubleCaps;
OUString m_sStartCap;
OUString m_sBoldUnderline;
OUString m_sURL;
OUString m_sNoDblSpaces;
OUString m_sDash;
OUString m_sNonBrkSpace;
OUString m_sFirst;
OUString m_sAccidentalCaps;
2009-10-30 18:36:06 -05:00
public:
OfaAutocorrOptionsPage(Window* pParent, const SfxItemSet& rSet);
2009-10-30 18:36:06 -05:00
static SfxTabPage* Create( Window* pParent,
const SfxItemSet& rAttrSet);
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
2009-10-30 18:36:06 -05:00
virtual void Reset( const SfxItemSet& rSet );
virtual void ActivatePage( const SfxItemSet& );
};
// class OfaSwAutoFmtOptionsPage ----------------------------------------------------
class OfaSwAutoFmtOptionsPage : public SfxTabPage
{
using TabPage::ActivatePage;
OfaACorrCheckListBox* m_pCheckLB;
PushButton* m_pEditPB;
2009-10-30 18:36:06 -05:00
OUString sDeleteEmptyPara;
OUString sUseReplaceTbl;
OUString sCptlSttWord;
OUString sCptlSttSent;
OUString sUserStyle;
OUString sBullet;
OUString sByInputBullet;
OUString sBoldUnder;
OUString sNoDblSpaces;
OUString sCorrectCapsLock;
OUString sDetectURL;
OUString sDash;
OUString sNonBrkSpace;
OUString sOrdinal;
OUString sRightMargin;
OUString sNum;
OUString sBorder;
OUString sTable;
OUString sReplaceTemplates;
OUString sDelSpaceAtSttEnd;
OUString sDelSpaceBetweenLines;
OUString sMargin;
OUString sBulletChar;
OUString sByInputBulletChar;
2009-10-30 18:36:06 -05:00
Font aBulletFont;
Font aByInputBulletFont;
sal_uInt16 nPercent;
2009-10-30 18:36:06 -05:00
SvLBoxButtonData* pCheckButtonData;
DECL_LINK(SelectHdl, OfaACorrCheckListBox*);
DECL_LINK(EditHdl, void *);
SvTreeListEntry* CreateEntry(OUString& rTxt, sal_uInt16 nCol);
2009-10-30 18:36:06 -05:00
OfaSwAutoFmtOptionsPage( Window* pParent,
const SfxItemSet& rSet );
~OfaSwAutoFmtOptionsPage();
public:
static SfxTabPage* Create( Window* pParent,
const SfxItemSet& rAttrSet);
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
2009-10-30 18:36:06 -05:00
virtual void Reset( const SfxItemSet& rSet );
virtual void ActivatePage( const SfxItemSet& );
};
// class AutoCorrEdit ----------------------------------------------------
class AutoCorrEdit : public Edit
{
Link aActionLink;
sal_Bool bSpaces;
2009-10-30 18:36:06 -05:00
public:
AutoCorrEdit(Window* pParent, const ResId& rResId) :
Edit(pParent, rResId), bSpaces(sal_False){}
AutoCorrEdit(Window* pParent) :
Edit(pParent), bSpaces(sal_False){}
2009-10-30 18:36:06 -05:00
void SetActionHdl( const Link& rLink )
{ aActionLink = rLink;}
void SetSpaces(sal_Bool bSet)
2009-10-30 18:36:06 -05:00
{bSpaces = bSet;}
virtual void KeyInput( const KeyEvent& rKEvent );
};
// class OfaAutocorrReplacePage ------------------------------------------
struct DoubleString
{
OUString sShort;
OUString sLong;
void* pUserData; ///< CheckBox -> form. Text Bool -> selection text
};
typedef std::vector<DoubleString> DoubleStringArray;
typedef std::map<LanguageType, DoubleStringArray> DoubleStringTable;
2009-10-30 18:36:06 -05:00
struct StringChangeList
{
DoubleStringArray aNewEntries;
DoubleStringArray aDeletedEntries;
};
typedef std::map<LanguageType, StringChangeList> StringChangeTable;
2009-10-30 18:36:06 -05:00
class OfaAutocorrReplacePage : public SfxTabPage
{
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
StringChangeTable aChangesTable;
CheckBox* m_pTextOnlyCB;
AutoCorrEdit* m_pShortED;
AutoCorrEdit* m_pReplaceED;
SvTabListBox* m_pReplaceTLB;
PushButton* m_pNewReplacePB;
PushButton* m_pDeleteReplacePB;
OUString sModify;
OUString sNew;
2009-10-30 18:36:06 -05:00
std::set<OUString> aFormatText;
2009-10-30 18:36:06 -05:00
DoubleStringTable aDoubleStringTable;
CollatorWrapper* pCompareClass;
CharClass* pCharClass;
LanguageType eLang;
sal_Bool bHasSelectionText;
sal_Bool bFirstSelect:1;
sal_Bool bReplaceEditChanged:1;
sal_Bool bSWriter:1;
2009-10-30 18:36:06 -05:00
DECL_LINK(SelectHdl, SvTabListBox*);
DECL_LINK(NewDelHdl, PushButton*);
DECL_LINK(ModifyHdl, Edit*);
void RefillReplaceBox( sal_Bool bFromReset,
LanguageType eOldLanguage,
LanguageType eNewLanguage);
2009-10-30 18:36:06 -05:00
public:
OfaAutocorrReplacePage( Window* pParent, const SfxItemSet& rSet );
~OfaAutocorrReplacePage();
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
2009-10-30 18:36:06 -05:00
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
2009-10-30 18:36:06 -05:00
virtual void Reset( const SfxItemSet& rSet );
virtual void ActivatePage( const SfxItemSet& );
virtual int DeactivatePage( SfxItemSet* pSet = 0 );
virtual void Resize();
2009-10-30 18:36:06 -05:00
void SetLanguage(LanguageType eSet);
void DeleteEntry(OUString sShort, OUString sLong);
void NewEntry(OUString sShort, OUString sLong, bool bKeepSourceFormatting);
2009-10-30 18:36:06 -05:00
};
// class OfaAutocorrExceptPage ---------------------------------------------
struct StringsArrays
{
std::vector<OUString> aAbbrevStrings;
std::vector<OUString> aDoubleCapsStrings;
StringsArrays() { }
};
typedef std::map<LanguageType, StringsArrays> StringsTable;
2009-10-30 18:36:06 -05:00
class OfaAutocorrExceptPage : public SfxTabPage
{
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
AutoCorrEdit* m_pAbbrevED;
ListBox* m_pAbbrevLB;
PushButton* m_pNewAbbrevPB;
PushButton* m_pDelAbbrevPB;
CheckBox* m_pAutoAbbrevCB;
AutoCorrEdit* m_pDoubleCapsED;
ListBox* m_pDoubleCapsLB;
PushButton* m_pNewDoublePB;
PushButton* m_pDelDoublePB;
CheckBox* m_pAutoCapsCB;
StringsTable aStringsTable;
CollatorWrapper* pCompareClass;
LanguageType eLang;
2009-10-30 18:36:06 -05:00
DECL_LINK(NewDelHdl, PushButton*);
DECL_LINK(SelectHdl, ListBox*);
DECL_LINK(ModifyHdl, Edit*);
/// Box filled with new language
void RefillReplaceBoxes(sal_Bool bFromReset,
2009-10-30 18:36:06 -05:00
LanguageType eOldLanguage,
LanguageType eNewLanguage);
public:
OfaAutocorrExceptPage( Window* pParent, const SfxItemSet& rSet );
~OfaAutocorrExceptPage();
static SfxTabPage* Create( Window* pParent,
const SfxItemSet& rAttrSet);
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
2009-10-30 18:36:06 -05:00
virtual void Reset( const SfxItemSet& rSet );
virtual void ActivatePage( const SfxItemSet& );
virtual int DeactivatePage( SfxItemSet* pSet = 0 );
void SetLanguage(LanguageType eSet);
};
// class OfaQuoteTabPage -------------------------------------------------
class OfaQuoteTabPage : public SfxTabPage
{
using TabPage::ActivatePage;
private:
/// For anything but writer
SvxCheckListBox* m_pCheckLB;
2010-01-12 07:54:42 -06:00
/// Just for writer
OfaACorrCheckListBox* m_pSwCheckLB;
2010-01-12 07:54:42 -06:00
OUString sNonBrkSpace;
OUString sOrdinal;
2010-01-12 07:54:42 -06:00
SvLBoxButtonData* pCheckButtonData;
2009-10-30 18:36:06 -05:00
CheckBox* m_pSingleTypoCB;
PushButton* m_pSglStartQuotePB;
FixedText* m_pSglStartExFT;
PushButton* m_pSglEndQuotePB;
FixedText* m_pSglEndExFT;
PushButton* m_pSglStandardPB;
CheckBox* m_pDoubleTypoCB;
PushButton* m_pDblStartQuotePB;
FixedText* m_pDblStartExFT;
PushButton* m_pDblEndQuotePB;
FixedText* m_pDblEndExFT;
PushButton* m_pDblStandardPB;
OUString m_sStartQuoteDlg;
OUString m_sEndQuoteDlg;
OUString m_sStandard;
2009-10-30 18:36:06 -05:00
sal_UCS4 cSglStartQuote;
sal_UCS4 cSglEndQuote;
sal_UCS4 cStartQuote;
sal_UCS4 cEndQuote;
DECL_LINK( QuoteHdl, PushButton* );
DECL_LINK( StdQuoteHdl, PushButton* );
OUString ChangeStringExt_Impl( sal_UCS4 );
2009-10-30 18:36:06 -05:00
SvTreeListEntry* CreateEntry(OUString& rTxt, sal_uInt16 nCol);
2010-01-12 07:54:42 -06:00
2009-10-30 18:36:06 -05:00
OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet );
public:
~OfaQuoteTabPage();
static SfxTabPage* Create( Window* pParent,
const SfxItemSet& rAttrSet);
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
2009-10-30 18:36:06 -05:00
virtual void Reset( const SfxItemSet& rSet );
virtual void ActivatePage( const SfxItemSet& );
};
// class OfaAutoCompleteTabPage ---------------------------------------------
class OfaAutoCompleteTabPage : public SfxTabPage
{
using TabPage::ActivatePage;
class AutoCompleteMultiListBox : public MultiListBox
{
OfaAutoCompleteTabPage& rPage;
public:
AutoCompleteMultiListBox( OfaAutoCompleteTabPage& rPg,
const ResId& rResId )
: MultiListBox( &rPg, rResId ), rPage( rPg ) {}
virtual long PreNotify( NotifyEvent& rNEvt );
};
CheckBox aCBActiv; ///<Enable word completion
CheckBox aCBAppendSpace;///<Append space
CheckBox aCBAsTip; ///<Show as tip
2009-10-30 18:36:06 -05:00
CheckBox aCBCollect;///<Collect words
CheckBox aCBRemoveList;///<...save the list for later use...
2009-10-30 18:36:06 -05:00
FixedText aFTExpandKey;
ListBox aDCBExpandKey;
FixedText aFTMinWordlen;
NumericField aNFMinWordlen;
FixedText aFTMaxEntries;
NumericField aNFMaxEntries;
AutoCompleteMultiListBox aLBEntries;
PushButton aPBEntries;
editeng::SortedAutoCompleteStrings* m_pAutoCompleteList;
sal_uInt16 nAutoCmpltListCnt;
2009-10-30 18:36:06 -05:00
DECL_LINK( CheckHdl, CheckBox* );
OfaAutoCompleteTabPage( Window* pParent,
const SfxItemSet& rSet );
public:
virtual ~OfaAutoCompleteTabPage();
static SfxTabPage* Create( Window* pParent,
const SfxItemSet& rAttrSet);
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
2009-10-30 18:36:06 -05:00
virtual void Reset( const SfxItemSet& rSet );
virtual void ActivatePage( const SfxItemSet& );
void CopyToClipboard() const;
DECL_LINK(DeleteHdl, void *);
2009-10-30 18:36:06 -05:00
};
// class OfaSmartTagOptionsTabPage ---------------------------------------------
/** Smart tag options tab page
This tab page is used to enable/disable smart tag types
*/
class OfaSmartTagOptionsTabPage : public SfxTabPage
{
using TabPage::ActivatePage;
private:
// controls
CheckBox m_aMainCB;
SvxCheckListBox m_aSmartTagTypesLB;
PushButton m_aPropertiesPB;
FixedText m_aTitleFT;
/// construction via Create()
2009-10-30 18:36:06 -05:00
OfaSmartTagOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
/** Inserts items into m_aSmartTagTypesLB
Reads out the smart tag types supported by the SmartTagMgr and
inserts the associated strings into the list box.
*/
void FillListBox( const SmartTagMgr& rSmartTagMgr );
/** Clears the m_aSmartTagTypesLB
*/
void ClearListBox();
/** Handler for the check box
Enables/disables all controls in the tab page (except from the
check box.
*/
DECL_LINK(CheckHdl, void *);
2009-10-30 18:36:06 -05:00
/** Handler for the push button
Calls the displayPropertyPage function of the smart tag recognizer
associated with the currently selected smart tag type.
*/
DECL_LINK(ClickHdl, void *);
2009-10-30 18:36:06 -05:00
/** Handler for the list box
Enables/disables the properties push button if selection in the
smart tag types list box changes.
*/
DECL_LINK(SelectHdl, void *);
2009-10-30 18:36:06 -05:00
public:
virtual ~OfaSmartTagOptionsTabPage();
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
2009-10-30 18:36:06 -05:00
virtual void Reset( const SfxItemSet& rSet );
virtual void ActivatePage( const SfxItemSet& );
};
#endif
2009-10-30 18:36:06 -05:00
2010-10-27 06:45:03 -05:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */