summaryrefslogtreecommitdiffstats
path: root/svtools/source/control/urlcontrol.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-08-02 13:36:56 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-08-02 13:36:56 +0000
commitf061dc6cd12772bf0681c65fbbb1ce31306d405a (patch)
treecd08e9d197303a7f6b2212b86e5302316f4013f8 /svtools/source/control/urlcontrol.cxx
parentINTEGRATION: CWS insight01 (1.10.4); FILE MERGED (diff)
downloadcore-f061dc6cd12772bf0681c65fbbb1ce31306d405a.tar.gz
core-f061dc6cd12772bf0681c65fbbb1ce31306d405a.zip
INTEGRATION: CWS insight01 (1.1.2); FILE ADDED
2004/03/05 07:26:34 oj 1.1.2.1: #111090# new classes from dbaccess
Diffstat (limited to 'svtools/source/control/urlcontrol.cxx')
-rw-r--r--svtools/source/control/urlcontrol.cxx130
1 files changed, 130 insertions, 0 deletions
diff --git a/svtools/source/control/urlcontrol.cxx b/svtools/source/control/urlcontrol.cxx
new file mode 100644
index 000000000000..dec87adb6903
--- /dev/null
+++ b/svtools/source/control/urlcontrol.cxx
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: urlcontrol.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2004-08-02 14:36:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (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.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SVTOOL_URLCONTROL_HXX
+#include "urlcontrol.hxx"
+#endif
+#ifndef SVTOOLS_FILENOTATION_HXX_
+#include "filenotation.hxx"
+#endif
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OFileURLControl
+ //=====================================================================
+ //---------------------------------------------------------------------
+ OFileURLControl::OFileURLControl(Window* _pParent)
+ :SvtURLBox(_pParent, INET_PROT_FILE)
+ {
+ DisableHistory();
+ }
+
+ //---------------------------------------------------------------------
+ OFileURLControl::OFileURLControl(Window* _pParent, const ResId& _rId)
+ :SvtURLBox(_pParent, _rId, INET_PROT_FILE)
+ {
+ DisableHistory();
+ }
+
+ //---------------------------------------------------------------------
+ long OFileURLControl::PreNotify( NotifyEvent& _rNEvt )
+ {
+ if (GetSubEdit() == _rNEvt.GetWindow())
+ if (EVENT_KEYINPUT == _rNEvt.GetType())
+ if (KEY_RETURN == _rNEvt.GetKeyEvent()->GetKeyCode().GetCode())
+ if (IsInDropDown())
+ m_sPreservedText = GetURL();
+
+ return SvtURLBox::PreNotify(_rNEvt);
+ }
+
+ //---------------------------------------------------------------------
+ long OFileURLControl::Notify( NotifyEvent& _rNEvt )
+ {
+ if (GetSubEdit() == _rNEvt.GetWindow())
+ if (EVENT_KEYINPUT == _rNEvt.GetType())
+ if (KEY_RETURN == _rNEvt.GetKeyEvent()->GetKeyCode().GetCode())
+ if (IsInDropDown())
+ {
+ long nReturn = SvtURLBox::Notify(_rNEvt);
+
+ // build a system dependent (thus more user readable) file name
+ OFileNotation aTransformer(m_sPreservedText, OFileNotation::N_URL);
+ SetText(aTransformer.get(OFileNotation::N_SYSTEM));
+ Modify();
+
+ // Update the pick list
+ UpdatePickList();
+
+ return nReturn;
+ }
+
+ return SvtURLBox::Notify(_rNEvt);
+ }
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+