2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-10-05 09:09:48 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:27:16 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 14:27:16 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 14:27:16 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 14:27:16 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 14:27:16 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
2008-04-10 14:27:16 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-10-05 09:09:48 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _DBAUI_CURLEDIT_HXX_
|
|
|
|
#define _DBAUI_CURLEDIT_HXX_
|
|
|
|
|
|
|
|
#include <vcl/edit.hxx>
|
|
|
|
#include <vcl/fixed.hxx>
|
|
|
|
#include "dsntypes.hxx"
|
2009-07-03 12:24:35 +00:00
|
|
|
#include <memory>
|
2000-10-05 09:09:48 +00:00
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
//.........................................................................
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
//= OConnectionURLEdit
|
|
|
|
//=========================================================================
|
|
|
|
/** an edit control which may be used to edit connection URLs like
|
|
|
|
"sdbc:odbc:" or "jdbc:". It prevents the user from editing this prefix,
|
|
|
|
though it is normally shown.
|
|
|
|
*/
|
|
|
|
class OConnectionURLEdit : public Edit
|
|
|
|
{
|
2009-07-03 12:24:35 +00:00
|
|
|
::dbaccess::ODsnTypeCollection*
|
|
|
|
m_pTypeCollection;
|
2000-10-05 09:09:48 +00:00
|
|
|
FixedText* m_pForcedPrefix;
|
2001-05-08 08:55:03 +00:00
|
|
|
String m_sSaveValueNoPrefix;
|
2011-01-14 15:00:11 +01:00
|
|
|
sal_Bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not
|
2000-10-05 09:09:48 +00:00
|
|
|
|
|
|
|
public:
|
2011-01-14 15:00:11 +01:00
|
|
|
OConnectionURLEdit(Window* pParent, const ResId& rResId,sal_Bool _bShowPrefix = sal_False);
|
2000-10-05 09:09:48 +00:00
|
|
|
~OConnectionURLEdit();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Edit overridables
|
|
|
|
virtual void SetText(const String& _rStr);
|
|
|
|
virtual void SetText(const String& _rStr, const Selection& _rNewSelection);
|
|
|
|
virtual String GetText() const;
|
2000-10-24 11:08:19 +00:00
|
|
|
|
2004-08-02 14:56:33 +00:00
|
|
|
|
|
|
|
/** Showsthe Prefix
|
|
|
|
@param _bShowPrefix
|
|
|
|
If <TRUE/> than the prefix will be visible, otherwise not.
|
|
|
|
*/
|
2011-01-14 15:00:11 +01:00
|
|
|
void ShowPrefix(sal_Bool _bShowPrefix);
|
2000-10-24 11:08:19 +00:00
|
|
|
/// get the currently set text, excluding the prefix indicating the type
|
|
|
|
virtual String GetTextNoPrefix() const;
|
|
|
|
/// set a new text, leave the current prefix unchanged
|
|
|
|
virtual void SetTextNoPrefix(const String& _rText);
|
2001-05-08 08:55:03 +00:00
|
|
|
|
2003-03-19 16:57:12 +00:00
|
|
|
inline void SaveValueNoPrefix() { m_sSaveValueNoPrefix = GetTextNoPrefix(); }
|
|
|
|
inline String GetSavedValueNoPrefix() const { return m_sSaveValueNoPrefix; }
|
2009-07-03 12:24:35 +00:00
|
|
|
inline void SetTypeCollection(::dbaccess::ODsnTypeCollection* _pTypeCollection) { m_pTypeCollection = _pTypeCollection; }
|
2000-10-05 09:09:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
} // namespace dbaui
|
|
|
|
//.........................................................................
|
|
|
|
|
|
|
|
#endif // _DBAUI_CURLEDIT_HXX_
|
|
|
|
|
2010-10-27 12:33:13 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|