API  1.0.0
CPFlashMovie.j
Go to the documentation of this file.
1 /*
2  * CPFlashMovie.j
3  * AppKit
4  *
5  * Created by Francisco Tolmasky.
6  * Copyright 2008, 280 North, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 
24 
30 @implementation CPFlashMovie : CPObject
31 {
32  CPString _filename;
33 }
34 
40 + (id)flashMovieWithFile:(CPString)aFilename
41 {
42  return [[self alloc] initWithFile:aFilename];
43 }
44 
50 - (id)initWithFile:(CPString)aFilename
51 {
52  self = [super init];
53 
54  if (self)
55  _filename = aFilename;
56 
57  return self;
58 }
59 
60 - (CPString)filename
61 {
62  return _filename;
63 }
64 
65 @end
66 
67 var CPFlashMovieFilenameKey = "CPFlashMovieFilenameKey";
68 
69 @implementation CPFlashMovie (CPCoding)
70 
71 - (id)initWithCoder:(CPCoder)aCoder
72 {
73  _filename = [aCoder decodeObjectForKey:CPFlashMovieFilenameKey];
74 
75  return self;
76 }
77 
78 - (void)encodeWithCoder:(CPCoder)aCoder
79 {
80  [aCoder encodeObject:_filename forKey:CPFlashMovieFilenameKey];
81 }
82 
83 @end
var CPFlashMovieFilenameKey
Definition: CPFlashMovie.j:67
An immutable string (collection of characters).
Definition: CPString.h:2
id initWithFile:(CPString aFilename)
Definition: CPFlashMovie.j:50
Defines methods for use when archiving & restoring (enc/decoding).
Definition: CPCoder.h:2
id init()
Definition: CPObject.j:145
id alloc()
Definition: CPObject.j:130