1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #include "templatesearchview.hxx"
12 #include "templatesearchviewitem.hxx"
14 TemplateSearchView::TemplateSearchView (Window
*pParent
, WinBits nWinStyle
)
15 : ThumbnailView(pParent
,nWinStyle
)
19 TemplateSearchView::~TemplateSearchView ()
23 void TemplateSearchView::setOpenTemplateHdl(const Link
&rLink
)
25 maOpenTemplateHdl
= rLink
;
28 void TemplateSearchView::OnItemDblClicked (ThumbnailViewItem
*pItem
)
30 maOpenTemplateHdl
.Call(pItem
);
33 void TemplateSearchView::AppendItem(sal_uInt16 nAssocItemId
, sal_uInt16 nRegionId
, sal_uInt16 nIdx
,
34 const OUString
&rTitle
, const OUString
&rSubtitle
,
35 const OUString
&rPath
,
36 const BitmapEx
&rImage
)
38 TemplateSearchViewItem
*pItem
= new TemplateSearchViewItem(*this);
39 pItem
->mnId
= getNextItemId();
40 pItem
->mnAssocId
= nAssocItemId
;
41 pItem
->mnDocId
= nIdx
;
42 pItem
->mnRegionId
= nRegionId
;
43 pItem
->maPreview1
= rImage
;
44 pItem
->maTitle
= rTitle
;
45 pItem
->setSubTitle(rSubtitle
);
46 pItem
->setPath(rPath
);
47 pItem
->setSelectClickHdl(LINK(this,ThumbnailView
,OnItemSelected
));
49 ThumbnailView::AppendItem(pItem
);
51 CalculateItemPositions();
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */