Files
libreoffice/fpicker/source/office/iodlgimp.hxx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

218 lines
6.9 KiB
C++
Raw Normal View History

2010-10-27 13:11:31 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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_FPICKER_SOURCE_OFFICE_IODLGIMP_HXX
#define INCLUDED_FPICKER_SOURCE_OFFICE_IODLGIMP_HXX
#include "PlacesListBox.hxx"
#include <vcl/idle.hxx>
#include <deque>
#include <memory>
#include <vector>
class CheckBox;
class SvtFileDialog;
#define FILEDIALOG_DEF_EXTSEP ';'
#define FILEDIALOG_DEF_WILDCARD '*'
// SvtFileDialogFilter_Impl
2011-03-04 16:36:58 +05:30
/* [Description]
2011-03-04 16:36:58 +05:30
Instances of this class represent a filter.
*/
class SvtFileDialogFilter_Impl
{
private:
OUString m_aName; // name of the entry
OUString m_aType; // filter wildcard - if empty, the entry marks a group
public:
SvtFileDialogFilter_Impl( const OUString& rName, const OUString& rType );
~SvtFileDialogFilter_Impl();
const OUString& GetName() const { return m_aName; }
const OUString& GetType() const { return m_aType; }
OUString GetExtension() const { return m_aType.getLength() > 2 ? m_aType.copy( 2 ) : OUString(); }
bool isGroupSeparator() const { return m_aType.isEmpty(); }
};
typedef std::deque<std::unique_ptr<SvtFileDialogFilter_Impl>> SvtFileDialogFilterList_Impl;
enum SvtFileDlgMode
{
FILEDLG_MODE_OPEN = 0,
FILEDLG_MODE_SAVE = 1
};
enum SvtFileDlgType
{
FILEDLG_TYPE_FILEDLG = 0,
FILEDLG_TYPE_PATHDLG
};
class SvtUpButton_Impl
{
private:
std::unique_ptr<weld::Toolbar> m_xToolbar;
std::unique_ptr<weld::Menu> m_xMenu;
SvtFileDialog* m_pDlg;
std::vector<OUString> aURLs;
public:
SvtUpButton_Impl(std::unique_ptr<weld::Toolbar> xToolbar,
std::unique_ptr<weld::Menu> xMenu,
SvtFileDialog* pDlg);
void set_help_id(const OString& rHelpId) { m_xToolbar->set_help_id(rHelpId); }
void show() { m_xToolbar->show(); }
void FillURLMenu();
weld::Widget* getWidget() { return m_xToolbar.get(); }
private:
DECL_LINK(SelectHdl, const OString&, void);
DECL_LINK(ClickHdl, const OString&, void);
};
class URLBox;
class SvtExpFileDlg_Impl
{
private:
const SvtFileDialogFilter_Impl* m_pCurFilter;
OUString m_sCurrentFilterDisplayName; // may differ from m_pCurFilter->GetName in case it is a cached entry
css::uno::Sequence< OUString > m_aBlackList;
CWS-TOOLING: integrate CWS cmis01 2009-02-03 20:05:24 +0100 tkr r267341 : #i95301# fixed crash due wrong array length + resolve merge conflicts 2009-01-12 08:35:39 +0100 tkr r266134 : #158978# support unescaped whitespaces in webdav 2009-01-12 08:33:10 +0100 tkr r266133 : #i95307# build error after rebasing fixed 2009-01-07 09:47:09 +0100 tkr r265948 : #159046# Add new path to the wntmsci12 search path 2009-01-05 15:34:19 +0100 tkr r265873 : CWS-TOOLING: rebase CWS cmis01 to trunk@265758 (milestone: DEV300:m38) 2008-12-23 09:38:53 +0100 tkr r265774 : #158537# new property 2008-12-23 09:36:25 +0100 tkr r265773 : #158537# new property 2008-10-29 13:08:30 +0100 mav r262791 : #i94273# let the interaction handler be used for authentication 2008-10-24 15:56:26 +0200 tkr r262649 : #i95310# NTLM support 2008-10-22 18:14:02 +0200 mav r262611 : #i94273# fix the http scenario 2008-10-22 12:41:12 +0200 tkr r262596 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:38:47 +0200 tkr r262595 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:38:31 +0200 tkr r262594 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:29:43 +0200 tkr r262593 : #i95307# Add blacklist support 2008-10-22 12:29:24 +0200 tkr r262592 : #i95307# Add blacklist support 2008-10-22 12:29:07 +0200 tkr r262591 : #i95307# Add blacklist support 2008-10-22 12:28:44 +0200 tkr r262590 : #i95307# Add blacklist support 2008-10-22 12:25:01 +0200 tkr r262589 : #i95307# Add blacklist support 2008-10-22 12:24:28 +0200 tkr r262588 : #i95307# Add blacklist support 2008-10-22 12:22:36 +0200 tkr r262587 : #i95307# Add blacklist support 2008-10-21 12:46:34 +0200 mav r262568 : #i94273# allow to specify the suggested on IO SaveAs directory and filename 2008-10-21 12:44:49 +0200 mav r262566 : #i94273# allow to specify the suggested on IO SaveAs directory and filename
2009-03-03 10:51:13 +00:00
public:
SvtFileDialogFilterList_Impl m_aFilter;
std::unique_ptr<SvtFileDialogFilter_Impl> m_xUserFilter;
std::unique_ptr<weld::Label> m_xFtFileName;
std::unique_ptr<URLBox> m_xEdFileName;
std::unique_ptr<weld::Label> m_xFtFileVersion;
std::unique_ptr<weld::ComboBox> m_xLbFileVersion;
std::unique_ptr<weld::Label> m_xFtTemplates;
std::unique_ptr<weld::ComboBox> m_xLbTemplates;
std::unique_ptr<weld::Label> m_xFtImageTemplates;
std::unique_ptr<weld::ComboBox> m_xLbImageTemplates;
std::unique_ptr<weld::Label> m_xFtImageAnchor;
std::unique_ptr<weld::ComboBox> m_xLbImageAnchor;
std::unique_ptr<weld::Label> m_xFtFileType;
std::unique_ptr<weld::ComboBox> m_xLbFilter;
std::unique_ptr<weld::Button> m_xBtnFileOpen;
std::unique_ptr<weld::Button> m_xBtnCancel;
std::unique_ptr<weld::Button> m_xBtnHelp;
std::unique_ptr<SvtUpButton_Impl> m_xBtnUp;
std::unique_ptr<weld::Button> m_xBtnNewFolder;
std::unique_ptr<weld::CheckButton> m_xCbPassword;
std::unique_ptr<weld::CheckButton> m_xCbGPGEncrypt;
std::unique_ptr<URLBox> m_xEdCurrentPath;
std::unique_ptr<weld::CheckButton> m_xCbAutoExtension;
std::unique_ptr<weld::CheckButton> m_xCbOptions;
std::unique_ptr<PlacesListBox> m_xPlaces;
std::unique_ptr<weld::Button> m_xBtnConnectToServer;
SvtFileDlgMode m_eMode;
SvtFileDlgType m_eDlgType;
PickerFlags m_nStyle;
OUString m_aStdDir;
2011-03-04 16:36:58 +05:30
// delay filter when traveling the filterbox
Idle m_aFilterIdle;
2011-03-04 16:36:58 +05:30
// shows OpenHdl_Imp() if the open was triggered by a double click
bool m_bDoubleClick;
2011-03-04 16:36:58 +05:30
// MultiSelection?
bool m_bMultiSelection;
// remember sizes
OUString m_aIniKey;
explicit SvtExpFileDlg_Impl();
~SvtExpFileDlg_Impl();
CWS-TOOLING: integrate CWS cmis01 2009-02-03 20:05:24 +0100 tkr r267341 : #i95301# fixed crash due wrong array length + resolve merge conflicts 2009-01-12 08:35:39 +0100 tkr r266134 : #158978# support unescaped whitespaces in webdav 2009-01-12 08:33:10 +0100 tkr r266133 : #i95307# build error after rebasing fixed 2009-01-07 09:47:09 +0100 tkr r265948 : #159046# Add new path to the wntmsci12 search path 2009-01-05 15:34:19 +0100 tkr r265873 : CWS-TOOLING: rebase CWS cmis01 to trunk@265758 (milestone: DEV300:m38) 2008-12-23 09:38:53 +0100 tkr r265774 : #158537# new property 2008-12-23 09:36:25 +0100 tkr r265773 : #158537# new property 2008-10-29 13:08:30 +0100 mav r262791 : #i94273# let the interaction handler be used for authentication 2008-10-24 15:56:26 +0200 tkr r262649 : #i95310# NTLM support 2008-10-22 18:14:02 +0200 mav r262611 : #i94273# fix the http scenario 2008-10-22 12:41:12 +0200 tkr r262596 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:38:47 +0200 tkr r262595 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:38:31 +0200 tkr r262594 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:29:43 +0200 tkr r262593 : #i95307# Add blacklist support 2008-10-22 12:29:24 +0200 tkr r262592 : #i95307# Add blacklist support 2008-10-22 12:29:07 +0200 tkr r262591 : #i95307# Add blacklist support 2008-10-22 12:28:44 +0200 tkr r262590 : #i95307# Add blacklist support 2008-10-22 12:25:01 +0200 tkr r262589 : #i95307# Add blacklist support 2008-10-22 12:24:28 +0200 tkr r262588 : #i95307# Add blacklist support 2008-10-22 12:22:36 +0200 tkr r262587 : #i95307# Add blacklist support 2008-10-21 12:46:34 +0200 mav r262568 : #i94273# allow to specify the suggested on IO SaveAs directory and filename 2008-10-21 12:44:49 +0200 mav r262566 : #i94273# allow to specify the suggested on IO SaveAs directory and filename
2009-03-03 10:51:13 +00:00
void SetBlackList( const css::uno::Sequence< OUString >& rBlackList ) { m_aBlackList = rBlackList; }
const css::uno::Sequence< OUString >& GetBlackList() const { return m_aBlackList; }
void SetStandardDir( const OUString& rDir );
const OUString& GetStandardDir() const { return m_aStdDir; }
// access to the filter listbox only as weld::Widget* - we want to maintain the entries/userdata ourself
weld::Widget* GetFilterListControl() { return m_xLbFilter.get(); }
const weld::Widget* GetFilterListControl() const { return m_xLbFilter.get(); }
void SetFilterListSelectHdl(const Link<weld::ComboBox&, void>& rHandler)
{
m_xLbFilter->connect_changed(rHandler);
}
// inits the listbox for the filters from the filter list (_pFilter)
void InitFilterList( );
bool HasFilterListEntry( const OUString& rFilterName )
{
return m_xLbFilter->find_text(rFilterName) != -1;
}
void SelectFilterListEntry( const OUString& rFilterName )
{
m_xLbFilter->set_active_text(rFilterName);
}
void InsertFilterListEntry( const SvtFileDialogFilter_Impl* _pFilterDesc );
// _pFilterDesc must already have been added to _pFilter
SvtFileDialogFilter_Impl* GetSelectedFilterEntry( OUString& rDisplayName ) const
{
rDisplayName = m_xLbFilter->get_active_text();
return reinterpret_cast<SvtFileDialogFilter_Impl*>(m_xLbFilter->get_active_id().toInt64());
}
// access to the current filter via methods only - need to care for consistency between m_pCurFilter and m_sCurrentFilterDisplayName
const SvtFileDialogFilter_Impl* GetCurFilter( ) const
{
return m_pCurFilter;
}
const OUString& GetCurFilterDisplayName() const
{
return m_sCurrentFilterDisplayName;
}
void SetCurFilter( SvtFileDialogFilter_Impl const * _pFilter, const OUString& rDisplayName );
};
#endif // INCLUDED_FPICKER_SOURCE_OFFICE_IODLGIMP_HXX
2010-10-27 13:11:31 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */