2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02: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 .
|
|
|
|
*/
|
2000-09-18 16:15:01 +00:00
|
|
|
#ifndef _DBTREE_HXX
|
|
|
|
#define _DBTREE_HXX
|
|
|
|
|
2012-10-11 16:13:12 -04:00
|
|
|
#include <svtools/treelistbox.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <com/sun/star/uno/Reference.h>
|
2004-08-23 07:58:14 +00:00
|
|
|
|
|
|
|
#include "swdllapi.h"
|
2001-05-07 13:50:58 +00:00
|
|
|
#include <swtypes.hxx>
|
2004-08-23 07:58:14 +00:00
|
|
|
|
2001-07-17 11:34:55 +00:00
|
|
|
class SwDBTreeList_Impl;
|
2001-08-15 07:20:44 +00:00
|
|
|
class SwWrtShell;
|
2004-08-23 07:58:14 +00:00
|
|
|
|
|
|
|
class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2002-05-31 06:19:24 +00:00
|
|
|
ImageList aImageList;
|
2000-09-18 16:15:01 +00:00
|
|
|
Image aDBBMP;
|
|
|
|
Image aTableBMP;
|
|
|
|
Image aQueryBMP;
|
|
|
|
|
|
|
|
String sDefDBName;
|
2012-11-17 19:04:02 +09:00
|
|
|
bool bInitialized;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bShowColumns;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2001-07-17 11:34:55 +00:00
|
|
|
SwDBTreeList_Impl* pImpl;
|
|
|
|
|
2004-08-23 07:58:14 +00:00
|
|
|
SW_DLLPRIVATE DECL_LINK( DBCompare, SvSortData* );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-08-23 07:58:14 +00:00
|
|
|
SW_DLLPRIVATE void InitTreeList();
|
2012-10-18 16:28:20 +02:00
|
|
|
SW_DLLPRIVATE virtual void RequestingChildren( SvTreeListEntry* pParent );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-08-23 07:58:14 +00:00
|
|
|
SW_DLLPRIVATE virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
|
|
|
|
SW_DLLPRIVATE virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2007-10-22 14:17:40 +00:00
|
|
|
using SvTreeListBox::Select;
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2013-01-09 16:06:30 +00:00
|
|
|
SwDBTreeList( Window* pParent, const ResId& rResId,
|
2003-12-01 08:46:15 +00:00
|
|
|
SwWrtShell* pSh,
|
2001-08-15 07:20:44 +00:00
|
|
|
const String& rDefDBName = aEmptyStr,
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bShowCol = sal_False );
|
2013-01-09 16:06:30 +00:00
|
|
|
SwDBTreeList(Window* pParent);
|
2001-05-07 13:50:58 +00:00
|
|
|
virtual ~SwDBTreeList();
|
2013-01-14 10:40:11 +00:00
|
|
|
virtual Size GetOptimalSize() const;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
String GetDBName( String& rTableName, String& rColumnName, sal_Bool* pbIsTable = 0);
|
2007-09-27 10:57:11 +00:00
|
|
|
|
2001-05-07 13:50:58 +00:00
|
|
|
void Select( const String& rDBName, const String& rTableName,
|
|
|
|
const String& rColumnName );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void ShowColumns(sal_Bool bShowCol);
|
2003-12-01 08:46:15 +00:00
|
|
|
void SetWrtShell(SwWrtShell& rSh);
|
2004-08-02 13:23:03 +00:00
|
|
|
|
|
|
|
void AddDataSource(const String& rSource);
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|