update dev300-m58
[ooovba.git] / shell / source / win32 / shlxthandler / propsheets / listviewbuilder.hxx
blob15b629cba6d6929f71793ec90f1b666d69c71802
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: listviewbuilder.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef LISTVIEWBUILDER_HXX_INCLUDED
32 #define LISTVIEWBUILDER_HXX_INCLUDED
34 //------------------------------------
35 // include
36 //------------------------------------
38 #if defined _MSC_VER
39 #pragma warning(push, 1)
40 #endif
41 #include <windows.h>
42 #if defined _MSC_VER
43 #pragma warning(pop)
44 #endif
46 #include <string>
47 #include <memory>
48 #include "document_statistic.hxx"
50 //------------------------------------
52 //------------------------------------
54 class list_view_builder;
55 typedef std::auto_ptr<list_view_builder> list_view_builder_ptr;
57 // factory method for list_view_builder
58 list_view_builder_ptr create_list_view_builder(
59 HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
61 //------------------------------------
63 //------------------------------------
65 class list_view_builder
67 public:
68 virtual ~list_view_builder();
70 void build(statistic_group_list_t& gl);
72 protected:
73 list_view_builder(
74 HWND hwnd_list_view,
75 const std::wstring& column1_title,
76 const std::wstring& column2_title);
78 virtual void setup_list_view();
79 virtual void insert_group(const std::wstring& title);
80 virtual void insert_item(const std::wstring& title, const std::wstring& value, bool is_editable);
82 HWND get_list_view() const;
83 int get_current_row() const;
85 int row_index_;
87 private:
88 HWND hwnd_list_view_;
89 std::wstring column1_title_;
90 std::wstring column2_title_;
92 friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
95 //------------------------------------
97 //------------------------------------
99 class winxp_list_view_builder : public list_view_builder
101 protected:
102 winxp_list_view_builder(
103 HWND hwnd_list_view,
104 const std::wstring& column1_title,
105 const std::wstring& column2_title);
107 virtual void setup_list_view();
108 virtual void insert_group(const std::wstring& name);
109 virtual void insert_item(const std::wstring& title, const std::wstring& value, bool is_editable);
111 private:
112 int group_count_;
113 int row_count_;
115 friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
118 #endif