/*!
  @header FTVersion
  @abstract Module of FT
 
  @availability OS X, GNUstep
  @copyright 2004, 2005, 2006 Free Software Foundation, Inc.
  
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library 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
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA

  <pre>
  -------------------------------------------------------------------------
  Modification history

  04.10.05 ola     initial version
  23.08.06 ola     license changed
  -------------------------------------------------------------------------
  </pre>
*/

#if !defined(__FTVersion_H)
#define __FTVersion_H

#include <Foundation/Foundation.h>
#include <FT/FTObject.h>

/*!
 * @typedef ft_releaseState_t
 * @discussion Modes the state of a release.
 * <table>
     <tr><td>Flag</td><td>Description</td></tr>
     <tr><td>FT_VERSION_SNAPSHOT</td><td>Interims version</td></tr>
     <tr><td>FT_VERSION_ALPHA</td><td>Alpha version. 
       To be tested by developer</td></tr>
    <tr><td>FT_VERSION_BETA</td><td>Beta version; to be tested
      by user.</td></tr>
    <tr><td>FT_VERSION_RC</td><td>Release candidate; everything seems to
      be fine for launch.</td></tr>
    <tr><td>FT_VERSION_RELEASE</td><td>Final version; everythin is
      meant to be fine :)</td></tr>
 * </table>
 */
typedef enum {
  FT_VERSION_UNKNOWN = 0,
  FT_VERSION_SNAPSHOT,
  FT_VERSION_ALPHA,
  FT_VERSION_BETA,
  FT_VERSION_RC,
  FT_VERSION_RELEASE
} ft_releaseState_t;  
  
  
/*!
 * @protocol FTVersion
 * @abstract Models a version number
 * @discussion instances of this structure represent a version.
 * A version consists of a major, minor and a build number. The build number
 * increases with each build and snapshot of the artefact. "minor" increases 
 * for each shipment and only, if the shipment is not compatible with
 * the previous version. If "minor" increases this has no effect on "build" .
 * "major" increases for each release being shipped. In such a case "minor" 
 * and "build" reset to 0.
 */
@protocol FTVersion <FTObject>

/*!
 * @method build
 * @result build number
 */
- (unsigned) build;

/*!
 * @method major 
 * @result major version number
 */
- (unsigned) major;


/*!
 * @method minor
 * @result returns minor version number
 */
- (unsigned) minor;


/*!
 * @method releaseState
 * @result state of the release
 */
- (ft_releaseState_t) releaseState;


/*!
 * @method versionString
 * @abstract Used to create a unique string representation of the version.
 * @result string representation of the version
 */
- (NSString *) versionString;
@end
#endif
