Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : */
9 :
10 : #include "templatesearchview.hxx"
11 : #include "templatesearchviewitem.hxx"
12 :
13 : #include <vcl/builder.hxx>
14 :
15 0 : TemplateSearchView::TemplateSearchView (Window *pParent, WinBits nWinStyle)
16 0 : : ThumbnailView(pParent,nWinStyle)
17 : {
18 0 : }
19 :
20 0 : extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeTemplateSearchView(Window *pParent, VclBuilder::stringmap &)
21 : {
22 0 : return new TemplateSearchView(pParent);
23 : }
24 :
25 0 : TemplateSearchView::~TemplateSearchView ()
26 : {
27 0 : }
28 :
29 0 : void TemplateSearchView::setOpenTemplateHdl(const Link &rLink)
30 : {
31 0 : maOpenTemplateHdl = rLink;
32 0 : }
33 :
34 0 : void TemplateSearchView::OnItemDblClicked (ThumbnailViewItem *pItem)
35 : {
36 0 : maOpenTemplateHdl.Call(pItem);
37 0 : }
38 :
39 0 : void TemplateSearchView::AppendItem(sal_uInt16 nAssocItemId, sal_uInt16 nRegionId, sal_uInt16 nIdx,
40 : const OUString &rTitle, const OUString &rSubtitle,
41 : const OUString &rPath,
42 : const BitmapEx &rImage)
43 : {
44 0 : TemplateSearchViewItem *pItem = new TemplateSearchViewItem(*this, getNextItemId());
45 0 : pItem->mnAssocId = nAssocItemId;
46 0 : pItem->mnDocId = nIdx;
47 0 : pItem->mnRegionId = nRegionId;
48 0 : pItem->maPreview1 = rImage;
49 0 : pItem->maTitle = rTitle;
50 0 : pItem->setSubTitle(rSubtitle);
51 0 : pItem->setPath(rPath);
52 0 : pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
53 :
54 0 : ThumbnailView::AppendItem(pItem);
55 :
56 0 : CalculateItemPositions();
57 0 : }
58 :
59 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
60 :
61 :
|