Files
libreoffice/cui/source/inc/scriptdlg.hxx

211 lines
7.9 KiB
C++
Raw Normal View History

2010-10-27 12:45:03 +01: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 11:25:41 +01: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 .
*/
2009-10-31 00:36:06 +01:00
#ifndef INCLUDED_CUI_SOURCE_INC_SCRIPTDLG_HXX
#define INCLUDED_CUI_SOURCE_INC_SCRIPTDLG_HXX
2009-10-31 00:36:06 +01:00
#include <memory>
#include "tools/solar.h"
#include <svtools/treelistbox.hxx>
2009-10-31 00:36:06 +01:00
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/abstdlg.hxx>
#include <sfx2/basedlgs.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/script/browse/XBrowseNode.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <boost/unordered_map.hpp>
2009-10-31 00:36:06 +01:00
#define OBJTYPE_BASICMANAGER 1L
#define OBJTYPE_METHOD 2L
#define OBJTYPE_SCRIPTCONTAINER 3L
#define OBJTYPE_SFROOT 4L
#define INPUTMODE_NEWLIB 1
#define INPUTMODE_NEWMACRO 2
#define INPUTMODE_RENAME 3
typedef ::boost::unordered_map < OUString, OUString ,
OUStringHash, ::std::equal_to< OUString > > Selection_hash;
2009-10-31 00:36:06 +01:00
class SFEntry;
class SFTreeListBox : public SvTreeListBox
{
friend class SvxScriptOrgDialog;
private:
sal_uInt16 nMode;
2009-10-31 00:36:06 +01:00
Image m_hdImage;
Image m_libImage;
Image m_macImage;
Image m_docImage;
OUString m_sMyMacros;
OUString m_sProdMacros;
2009-10-31 00:36:06 +01:00
::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >
getLangNodeFromRootNode( ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& root, OUString& language );
void delUserData( SvTreeListEntry* pEntry );
2009-10-31 00:36:06 +01:00
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getDocumentModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xCtx, OUString& docName );
2009-10-31 00:36:06 +01:00
protected:
void ExpandTree( SvTreeListEntry* pRootEntry );
virtual void RequestingChildren( SvTreeListEntry* pParent );
2009-10-31 00:36:06 +01:00
virtual void ExpandedHdl();
virtual bool ExpandingHdl();
2009-10-31 00:36:06 +01:00
public:
void Init( const OUString& language );
void RequestSubEntries( SvTreeListEntry* pRootEntry, ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& node,
2009-10-31 00:36:06 +01:00
::com::sun::star::uno::Reference< com::sun::star::frame::XModel>& model );
SFTreeListBox(Window* pParent);
2009-10-31 00:36:06 +01:00
~SFTreeListBox();
void ExpandAllTrees();
SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap,
SvTreeListEntry * pParent,
2009-10-31 00:36:06 +01:00
bool bChildrenOnDemand,
std::auto_ptr< SFEntry > aUserData,
OUString factoryURL );
SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap,
SvTreeListEntry * pParent,
2009-10-31 00:36:06 +01:00
bool bChildrenOnDemand,
std::auto_ptr< SFEntry > aUserData );
void deleteTree( SvTreeListEntry * pEntry );
2009-10-31 00:36:06 +01:00
void deleteAllTree( );
};
class CuiInputDialog : public ModalDialog
2009-10-31 00:36:06 +01:00
{
private:
Edit* m_pEdit;
2009-10-31 00:36:06 +01:00
public:
CuiInputDialog(Window * pParent, sal_uInt16 nMode);
OUString GetObjectName() const { return m_pEdit->GetText(); }
void SetObjectName(const OUString& rName)
{
m_pEdit->SetText( rName );
m_pEdit->SetSelection( Selection( 0, rName.getLength() ) );
}
2009-10-31 00:36:06 +01:00
};
class SFEntry
{
private:
sal_uInt8 nType;
2009-10-31 00:36:06 +01:00
bool loaded;
::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > nodes;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > model;
SFEntry(){}
public:
SFEntry( sal_uInt8 nT ) { nType = nT; loaded=false; }
SFEntry( sal_uInt8 nT,
2009-10-31 00:36:06 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& entryNodes ,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& entryModel) { nType = nT; nodes = entryNodes; loaded=false; model = entryModel; }
SFEntry( const SFEntry& r ) { nType = r.nType; nodes = r.nodes; loaded = r.loaded; }
virtual ~SFEntry() {}
::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > GetNode() { return nodes ;}
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetModel() { return model ;};
sal_uInt8 GetType() const { return nType; }
2009-10-31 00:36:06 +01:00
bool isLoaded() const { return loaded; }
void setLoaded() { loaded=true; }
};
class SvxScriptOrgDialog : public SfxModalDialog
{
protected:
SFTreeListBox* m_pScriptsBox;
PushButton* m_pRunButton;
CloseButton* m_pCloseButton;
PushButton* m_pCreateButton;
PushButton* m_pEditButton;
PushButton* m_pRenameButton;
PushButton* m_pDelButton;
2009-10-31 00:36:06 +01:00
OUString m_sLanguage;
2009-10-31 00:36:06 +01:00
static Selection_hash m_lastSelection;
const OUString m_delErrStr;
const OUString m_delErrTitleStr;
const OUString m_delQueryStr;
const OUString m_delQueryTitleStr;
const OUString m_createErrStr;
const OUString m_createDupStr;
const OUString m_createErrTitleStr;
const OUString m_renameErrStr;
const OUString m_renameDupStr;
const OUString m_renameErrTitleStr;
2009-10-31 00:36:06 +01:00
DECL_LINK( MacroSelectHdl, SvTreeListBox * );
DECL_LINK( ScriptSelectHdl, SvTreeListBox * );
DECL_LINK( ButtonHdl, Button * );
sal_Bool getBoolProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xProps, OUString& propName );
2009-10-31 00:36:06 +01:00
void CheckButtons( ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& node );
void createEntry( SvTreeListEntry* pEntry );
void renameEntry( SvTreeListEntry* pEntry );
void deleteEntry( SvTreeListEntry* pEntry );
2009-10-31 00:36:06 +01:00
::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >
getBrowseNode( SvTreeListEntry* pEntry );
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getModel( SvTreeListEntry* pEntry );
OUString getListOfChildren( ::com::sun::star::uno::Reference< com::sun::star::script::browse::XBrowseNode > node, int depth );
2009-10-31 00:36:06 +01:00
void StoreCurrentSelection();
void RestorePreviousSelection();
public:
// prob need another arg in the ctor
// to specify the language or provider
SvxScriptOrgDialog( Window* pParent, OUString language );
2009-10-31 00:36:06 +01:00
~SvxScriptOrgDialog();
virtual short Execute();
};
class SvxScriptErrorDialog : public VclAbstractDialog
{
private:
OUString m_sMessage;
2009-10-31 00:36:06 +01:00
DECL_LINK( ShowDialog, OUString* );
2009-10-31 00:36:06 +01:00
public:
SvxScriptErrorDialog(
Window* parent, ::com::sun::star::uno::Any aException );
~SvxScriptErrorDialog();
short Execute();
};
#endif // INCLUDED_CUI_SOURCE_INC_SCRIPTDLG_HXX
2010-10-27 12:45:03 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */