juce_BorderSize.h

Go to the documentation of this file.
00001 /*
00002   ==============================================================================
00003 
00004    This file is part of the JUCE library - "Jules' Utility Class Extensions"
00005    Copyright 2004-7 by Raw Material Software ltd.
00006 
00007   ------------------------------------------------------------------------------
00008 
00009    JUCE can be redistributed and/or modified under the terms of the
00010    GNU General Public License, as published by the Free Software Foundation;
00011    either version 2 of the License, or (at your option) any later version.
00012 
00013    JUCE is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with JUCE; if not, visit www.gnu.org/licenses or write to the
00020    Free Software Foundation, Inc., 59 Temple Place, Suite 330,
00021    Boston, MA 02111-1307 USA
00022 
00023   ------------------------------------------------------------------------------
00024 
00025    If you'd like to release a closed-source product which uses JUCE, commercial
00026    licenses are also available: visit www.rawmaterialsoftware.com/juce for
00027    more information.
00028 
00029   ==============================================================================
00030 */
00031 
00032 #ifndef __JUCE_BORDERSIZE_JUCEHEADER__
00033 #define __JUCE_BORDERSIZE_JUCEHEADER__
00034 
00035 #include "juce_Rectangle.h"
00036 
00037 
00038 //==============================================================================
00047 class JUCE_API  BorderSize
00048 {
00049 public:
00050     //==============================================================================
00055     BorderSize() throw();
00056 
00058     BorderSize (const BorderSize& other) throw();
00059 
00061     BorderSize (const int topGap,
00062                 const int leftGap,
00063                 const int bottomGap,
00064                 const int rightGap) throw();
00065 
00067     BorderSize (const int allGaps) throw();
00068 
00070     ~BorderSize() throw();
00071 
00072     //==============================================================================
00074     int getTop() const throw()                          { return top; }
00075 
00077     int getLeft() const throw()                         { return left; }
00078 
00080     int getBottom() const throw()                       { return bottom; }
00081 
00083     int getRight() const throw()                        { return right; }
00084 
00086     int getTopAndBottom() const throw()                 { return top + bottom; }
00087 
00089     int getLeftAndRight() const throw()                 { return left + right; }
00090 
00091     //==============================================================================
00093     void setTop (const int newTopGap) throw();
00094 
00096     void setLeft (const int newLeftGap) throw();
00097 
00099     void setBottom (const int newBottomGap) throw();
00100 
00102     void setRight (const int newRightGap) throw();
00103 
00104     //==============================================================================
00106     const Rectangle subtractedFrom (const Rectangle& original) const throw();
00107 
00109     void subtractFrom (Rectangle& rectangle) const throw();
00110 
00112     const Rectangle addedTo (const Rectangle& original) const throw();
00113 
00115     void addTo (Rectangle& original) const throw();
00116 
00117     //==============================================================================
00118     bool operator== (const BorderSize& other) const throw();
00119     bool operator!= (const BorderSize& other) const throw();
00120 
00121 
00122     //==============================================================================
00123     juce_UseDebuggingNewOperator
00124 
00125 private:
00126     int top, left, bottom, right;
00127 };
00128 
00129 
00130 #endif   // __JUCE_BORDERSIZE_JUCEHEADER__