/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * 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 . */ #ifndef INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_GENERAL_HXX #define INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_GENERAL_HXX #include #include #include #include #include #include #include #include #include #include #include #include #include #include "bibshortcuthandler.hxx" class BibDataManager; #define TYPE_COUNT 22 #define FIELD_COUNT 31 /** * We need to split off the listener because both it and the vcl::Window baseclass are ref-counted */ class BibGeneralPage; class BibGeneralPageFocusListener : public cppu::WeakAggImplHelper1 < css::awt::XFocusListener > { private: VclPtr mpBibGeneralPage; public: explicit BibGeneralPageFocusListener(BibGeneralPage *pBibGeneralPage); virtual void SAL_CALL focusGained( const css::awt::FocusEvent& e ) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL focusLost( const css::awt::FocusEvent& e ) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw( css::uno::RuntimeException, std::exception ) override; }; class BibGeneralPage: public BibTabPage { VclPtr pGrid; VclPtr pScrolledWindow; VclPtr pIdentifierFT; VclPtr pAuthTypeFT; VclPtr pYearFT; VclPtr pAuthorFT; VclPtr pTitleFT; VclPtr pPublisherFT; VclPtr pAddressFT; VclPtr pISBNFT; VclPtr pChapterFT; VclPtr pPagesFT; VclPtr pEditorFT; VclPtr pEditionFT; VclPtr pBooktitleFT; VclPtr pVolumeFT; VclPtr pHowpublishedFT; VclPtr pOrganizationsFT; VclPtr pInstitutionFT; VclPtr pSchoolFT; VclPtr pReportTypeFT; VclPtr pMonthFT; VclPtr pJournalFT; VclPtr pNumberFT; VclPtr pSeriesFT; VclPtr pAnnoteFT; VclPtr pNoteFT; VclPtr pURLFT; VclPtr pCustom1FT; VclPtr pCustom2FT; VclPtr pCustom3FT; VclPtr pCustom4FT; VclPtr pCustom5FT; VclPtr aFixedTexts[ FIELD_COUNT ]; sal_Int16 nFT2CtrlMap[ FIELD_COUNT ]; css::uno::Reference< css::awt::XWindow > aControls[ FIELD_COUNT ]; OUString sErrorPrefix; OUString sTableErrorString; OUString sTypeColumnName; css::uno::Reference< css::awt::XControlContainer > xCtrlContnr; css::uno::Reference< css::form::XBoundComponent > xLBModel; css::uno::Reference< css::sdbc::XRowSetListener > xPosListener; rtl::Reference mxBibGeneralPageFocusListener; BibDataManager* pDatMan; css::uno::Reference< css::awt::XControlModel > AddXControl( const OUString& rName, FixedText& rLabel, const OString& sHelpId, sal_Int16& rIndex, std::vector& rChildren ); void AddControlWithError( const OUString& rColumnName, FixedText& rLabel, OUString& rErrorString, const OString& sHelpId, sal_uInt16 nIndexInFTArray, std::vector& rChildren ); protected: void InitFixedTexts(); // create mnemonics and set text an all fixed texts public: BibGeneralPage(vcl::Window* pParent, BibDataManager* pDatMan); virtual ~BibGeneralPage(); virtual void dispose() override; inline const OUString& GetErrorString() const; inline const css::uno::Reference< css::form::XBoundComponent >& GetTypeListBoxModel() const; inline const css::uno::Reference< css::awt::XControlContainer >& GetControlContainer() const; inline BibDataManager* GetDataManager(); void CommitActiveControl(); void RemoveListeners(); virtual void GetFocus() override; virtual bool HandleShortCutKey( const KeyEvent& rKeyEvent ) override; // returns true, if key was handled const rtl::Reference& GetFocusListener() { return mxBibGeneralPageFocusListener; } void focusGained(const css::awt::FocusEvent& rEvent) throw( css::uno::RuntimeException, std::exception ); void focusLost(const css::awt::FocusEvent& rEvent) throw( css::uno::RuntimeException, std::exception ); }; inline const OUString& BibGeneralPage::GetErrorString() const { return sTableErrorString; } inline const css::uno::Reference< css::form::XBoundComponent >& BibGeneralPage::GetTypeListBoxModel() const { return xLBModel; } inline const css::uno::Reference< css::awt::XControlContainer >& BibGeneralPage::GetControlContainer() const { return xCtrlContnr; } inline BibDataManager* BibGeneralPage::GetDataManager() { return pDatMan; } #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */