class_title_block.h 3.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#ifndef TITLE_BLOCK_H_
#define TITLE_BLOCK_H_
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

#include <wx/string.h>


29 30 31 32
class OUTPUTFORMATTER;
class IO_ERROR;


33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
extern wxString GenDate();


/**
 * Class TITLE_BLOCK
 * holds the information shown in the lower right corner of a plot, printout, or
 * editing view.
 *
 * @author Dick Hollenbeck
 */
class TITLE_BLOCK
{
public:
    // TITLE_BLOCK();

    void SetTitle( const wxString& aTitle )             { m_title = aTitle; }
    const wxString& GetTitle() const                    { return m_title; }

    /**
     * Function SetDate
     * sets the date field, and defaults to the current time and date.
     */
    void SetDate( const wxString& aDate = GenDate() )   { m_date = aDate; }
    const wxString& GetDate() const                     { return m_date; }

    void SetRevision( const wxString& aRevision )       { m_revision = aRevision; }
    const wxString& GetRevision() const                 { return m_revision; }

    void SetCompany( const wxString& aCompany )         { m_company = aCompany; }
    const wxString& GetCompany() const                  { return m_company; }

    void SetComment1( const wxString& aComment )        { m_comment1 = aComment; }
    const wxString& GetComment1() const                 { return m_comment1; }

    void SetComment2( const wxString& aComment )        { m_comment2 = aComment; }
    const wxString& GetComment2() const                 { return m_comment2; }

    void SetComment3( const wxString& aComment )        { m_comment3 = aComment; }
    const wxString& GetComment3() const                 { return m_comment3; }

    void SetComment4( const wxString& aComment )        { m_comment4 = aComment; }
    const wxString& GetComment4() const                 { return m_comment4; }

    void Clear()
    {
        m_title.clear();
        m_date.clear();
        m_revision.clear();
        m_company.clear();
        m_comment1.clear();
        m_comment2.clear();
        m_comment3.clear();
        m_comment4.clear();
    }

88 89 90 91 92 93 94 95 96 97 98 99
    /**
     * Function Format
     * outputs the object to \a aFormatter in s-expression form.
     *
     * @param aFormatter The #OUTPUTFORMATTER object to write to.
     * @param aNestLevel The indentation next level.
     * @param aControlBits The control bit definition for object specific formatting.
     * @throw IO_ERROR on write error.
     */
    virtual void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
        throw( IO_ERROR );

100 101 102 103 104 105 106 107 108 109 110 111
private:
    wxString    m_title;
    wxString    m_date;
    wxString    m_revision;
    wxString    m_company;
    wxString    m_comment1;
    wxString    m_comment2;
    wxString    m_comment3;
    wxString    m_comment4;
};

#endif // TITLE_BLOCK_H_